mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
pictureviewer: fix possible integer_overflow
This commit is contained in:
@@ -878,7 +878,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