Fix animated GIF invalid memory read causing possible crashes
parent
01364ebdb2
commit
60b78a0ec0
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue