mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
pictureviewer: fix possible integer_overflow
Origin commit data
------------------
Commit: eba5864fb2
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-02-02 (Sun, 02 Feb 2020)
This commit is contained in:
@@ -902,7 +902,11 @@ unsigned char * CPictureViewer::int_Resize(unsigned char *orgin, int ox, int oy,
|
|||||||
unsigned char * cr;
|
unsigned char * cr;
|
||||||
if(dst == NULL)
|
if(dst == NULL)
|
||||||
{
|
{
|
||||||
size_t bufsize = dx * dy * ((alpha) ? 4 : 3);
|
int ai = ((alpha) ? 4 : 3);
|
||||||
|
if (dy <= 1 || dx <= 1 || (dx *ai > INT_MAX / dy))
|
||||||
|
return orgin;
|
||||||
|
|
||||||
|
size_t bufsize = dx * dy * ai;
|
||||||
if (!checkfreemem(bufsize)){
|
if (!checkfreemem(bufsize)){
|
||||||
return orgin;
|
return orgin;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user