nsxiv3140638
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.
+1 −1
1 file changed
- M image.c +1 −1
| @@ -378,7 +378,7 @@ static bool img_load_webp(img_t *img, const fileinfo_t *file) | |||
| 378 | 378 | } | |
| 379 | 379 | ||
| 380 | 380 | /* Load and decode frames (also works on images with only 1 frame) */ | |
| 381 | − | m->cnt = m->sel = 0; | |
| 381 | + | m->length = m->cnt = m->sel = 0; | |
| 382 | 382 | while (WebPAnimDecoderGetNext(dec, &buf, &ts)) { | |
| 383 | 383 | im = imlib_create_image_using_copied_data( | |
| 384 | 384 | info.canvas_width, info.canvas_height, (uint32_t *)buf); | |