Fix animated GIF invalid memory read causing possible crashes

master
Richard Stanway 2015-04-09 13:05:16 +02:00
parent 01364ebdb2
commit 60b78a0ec0
1 changed files with 1 additions and 1 deletions

View File

@ -920,7 +920,7 @@ gif_result gif_decode_frame(gif_animation *gif, unsigned int frame) {
* image, find the last image set to "do not dispose" and get that frame data
*/
} else if ((frame != 0) && (gif->frames[frame - 1].disposal_method == GIF_FRAME_RESTORE)) {
while ((last_undisposed_frame != -1) && (gif->frames[--last_undisposed_frame].disposal_method == GIF_FRAME_RESTORE));
while ((last_undisposed_frame != -1) && (gif->frames[last_undisposed_frame--].disposal_method == GIF_FRAME_RESTORE));
/* If we don't find one, clear the frame data
*/
if (last_undisposed_frame == -1) {