mirror of
https://github.com/schnaader/precomp-cpp
synced 2026-08-23 00:23:04 -04:00
Change order of allocation and image descriptor check in GIF code
- Fixes #100 - Improves speed when processing invalid GIF files or false positives
This commit is contained in:
parent
7ebe71c421
commit
90f2353425
1 changed files with 4 additions and 4 deletions
|
|
@ -6212,6 +6212,10 @@ bool decompress_gif(FILE* srcfile, FILE* dstfile, long long src_pos, int& gif_le
|
|||
|
||||
switch (RecordType) {
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(myGifFile) == GIF_ERROR) {
|
||||
return d_gif_error(ScreenBuff, myGifFile);
|
||||
}
|
||||
|
||||
if (ScreenBuff == NULL) {
|
||||
ScreenBuff = alloc_gif_screenbuf(myGifFile);
|
||||
if (!ScreenBuff) {
|
||||
|
|
@ -6220,10 +6224,6 @@ bool decompress_gif(FILE* srcfile, FILE* dstfile, long long src_pos, int& gif_le
|
|||
}
|
||||
}
|
||||
|
||||
if (DGifGetImageDesc(myGifFile) == GIF_ERROR) {
|
||||
return d_gif_error(ScreenBuff, myGifFile);
|
||||
}
|
||||
|
||||
srcfile_pos = tell_64(srcfile);
|
||||
if (last_pos != srcfile_pos) {
|
||||
if (last_pos == -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue