mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- fixed crash on bad PNGs.
The cast to a signed long could create negative numbers which failed the sanity check and caused a stack corruption.
This commit is contained in:
parent
f049e6145b
commit
1febf277af
1 changed files with 1 additions and 1 deletions
|
@ -576,7 +576,7 @@ bool M_ReadIDAT (FileReader *file, uint8_t *buffer, int width, int height, int p
|
||||||
if (stream.avail_in == 0 && chunklen > 0)
|
if (stream.avail_in == 0 && chunklen > 0)
|
||||||
{
|
{
|
||||||
stream.next_in = chunkbuffer;
|
stream.next_in = chunkbuffer;
|
||||||
stream.avail_in = (uInt)file->Read (chunkbuffer, MIN<long>(chunklen,sizeof(chunkbuffer)));
|
stream.avail_in = (uInt)file->Read (chunkbuffer, MIN<uint32_t>(chunklen,sizeof(chunkbuffer)));
|
||||||
chunklen -= stream.avail_in;
|
chunklen -= stream.avail_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue