summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2021-11-27 00:01:18 +0600
committerKim Woelders <kim@woelders.dk>2021-11-29 17:37:20 +0100
commit524d439adf90518f5bfacbc17829142414fb23c3 (patch)
tree52eac87a77f5396f3673344f020f8a25a63628df
parente0e4f883e9c7614d8ca81524f33658f681a1ad39 (diff)
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.
-rw-r--r--src/modules/loaders/loader_webp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/modules/loaders/loader_webp.c b/src/modules/loaders/loader_webp.c
index 8079b79..c114715 100644
--- a/src/modules/loaders/loader_webp.c
+++ b/src/modules/loaders/loader_webp.c
@@ -39,6 +39,7 @@ load2(ImlibImage * im, int load_data)
39 if (im->key) 39 if (im->key)
40 { 40 {
41 frame = atoi(im->key); 41 frame = atoi(im->key);
42 iter.num_frames = WebPDemuxGetI(demux, WEBP_FF_FRAME_COUNT);
42 if (frame > iter.num_frames) 43 if (frame > iter.num_frames)
43 frame = 0; /* Select last */ 44 frame = 0; /* Select last */
44 } 45 }