mirror of
https://github.com/schnaader/precomp-cpp
synced 2026-08-23 00:23:04 -04:00
Fx issue #59
- Unhandled GIF_ERROR led to accessing uninitialized memory
This commit is contained in:
parent
d9f61c65d6
commit
86fa069bec
1 changed files with 9 additions and 1 deletions
10
precomp.cpp
10
precomp.cpp
|
|
@ -6972,7 +6972,15 @@ bool recompress_gif(FILE* srcfile, FILE* dstfile, unsigned char block_size, GifC
|
|||
}
|
||||
|
||||
// this does send a clear code, so we pass g and gd
|
||||
EGifPutImageDesc(newGifFile, g, gd, Row, Col, Width, Height, myGifFile->Image.Interlace, myGifFile->Image.ColorMap);
|
||||
if (EGifPutImageDesc(newGifFile, g, gd, Row, Col, Width, Height, myGifFile->Image.Interlace, myGifFile->Image.ColorMap) == GIF_ERROR) {
|
||||
for (i = 0; i < myGifFile->SHeight; i++) {
|
||||
delete[] ScreenBuff[i];
|
||||
}
|
||||
delete[] ScreenBuff;
|
||||
DGifCloseFile(myGifFile);
|
||||
EGifCloseFile(newGifFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
newgif_may_write = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue