mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
- MFH #33220, infinite loop while loading invalid GIF (nlopees)
This commit is contained in:
parent
a952406eb3
commit
c81c189198
@ -259,13 +259,13 @@ DoExtension(gdIOCtx *fd, int label, int *Transparent)
|
||||
if ((buf[0] & 0x1) != 0)
|
||||
*Transparent = buf[3];
|
||||
|
||||
while (GetDataBlock(fd, (unsigned char*) buf) != 0)
|
||||
while (GetDataBlock(fd, (unsigned char*) buf) > 0)
|
||||
;
|
||||
return FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
while (GetDataBlock(fd, (unsigned char*) buf) != 0)
|
||||
while (GetDataBlock(fd, (unsigned char*) buf) > 0)
|
||||
;
|
||||
|
||||
return FALSE;
|
||||
@ -337,7 +337,7 @@ GetCode_(gdIOCtx *fd, int code_size, int flag)
|
||||
buf[0] = buf[last_byte-2];
|
||||
buf[1] = buf[last_byte-1];
|
||||
|
||||
if ((count = GetDataBlock(fd, &buf[2])) == 0)
|
||||
if ((count = GetDataBlock(fd, &buf[2])) <= 0)
|
||||
done = TRUE;
|
||||
|
||||
last_byte = 2 + count;
|
||||
|
Loading…
Reference in New Issue
Block a user