WEBP loader: fix key selecting last frame

as far as i can tell, iter is being used uninitialized here leading to
reading garbage values resulting in the last frame always being selected
when key is present.
This commit is contained in:
NRK 2021-11-27 00:01:18 +06:00 committed by Kim Woelders
parent e0e4f883e9
commit 524d439adf
1 changed files with 1 additions and 0 deletions

View File

@ -39,6 +39,7 @@ load2(ImlibImage * im, int load_data)
if (im->key)
{
frame = atoi(im->key);
iter.num_frames = WebPDemuxGetI(demux, WEBP_FF_FRAME_COUNT);
if (frame > iter.num_frames)
frame = 0; /* Select last */
}