Skip to content

Commit 4c830d4

Browse files
committed
gif: report error on bogus LWZ data, instead of overflowing a buffer.
1 parent 5c6aaba commit 4c830d4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

IMG_gif.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ LWZReadByte(SDL_RWops *src, int flag, int input_code_size)
497497
return -3;
498498
}
499499
*sp++ = table[1][code];
500-
if (code == table[0][code])
501-
RWSetMsg("circular table entry BIG ERROR");
500+
if (code == table[0][code]) {
501+
RWSetMsg("circular table entry BIG ERROR");
502+
return -3;
503+
}
502504
code = table[0][code];
503505
}
504506

0 commit comments

Comments
 (0)