aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-10-25 20:34:19 +0200
committerNRK <nrk@disroot.org>2022-10-25 20:34:19 +0200
commit314063804293ff37ece428b512f8138ecd1eb7fc (patch)
tree95bc3070ab5cdc0b93a893e01a7535a2da982e17
parente197429489e098b2a0190330606f7022d3909644 (diff)
downloadnsxiv-314063804293ff37ece428b512f8138ecd1eb7fc.tar.zst
fix: wrong length on animated webp (#381)
the length member needed to be zero-ed before we started decoding. this was causing unintended behavior of playing an animated webp longer than it should under slideshow mode. Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/381 Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
-rw-r--r--image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/image.c b/image.c
index 6c8c465..2da4817 100644
--- a/image.c
+++ b/image.c
@@ -378,7 +378,7 @@ static bool img_load_webp(img_t *img, const fileinfo_t *file)
}
/* Load and decode frames (also works on images with only 1 frame) */
- m->cnt = m->sel = 0;
+ m->length = m->cnt = m->sel = 0;
while (WebPAnimDecoderGetNext(dec, &buf, &ts)) {
im = imlib_create_image_using_copied_data(
info.canvas_width, info.canvas_height, (uint32_t *)buf);