From f762a49c4957e6b8382fadae3b2da8d0b477f926 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Wed, 12 Oct 2022 19:30:44 +0200 Subject: [PATCH] PNG loader: Fix animated PNG loading some more --- src/modules/loaders/loader_png.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/loaders/loader_png.c b/src/modules/loaders/loader_png.c index fc7045f..03ca264 100644 --- a/src/modules/loaders/loader_png.c +++ b/src/modules/loaders/loader_png.c @@ -363,7 +363,13 @@ _load(ImlibImage * im, int load_data) D("\n"); if (im->frame_count == 0) goto scan_done; /* No acTL before IDAT - Regular PNG */ +#ifdef IMLIB2_DEBUG + break; /* Show all frames */ +#else + if (ctx.pch_fctl) + goto scan_done; /* Got fcTL before IDAT - APNG using default frame */ break; +#endif case PNG_TYPE_acTL: #define P (&chunk->actl) @@ -387,11 +393,7 @@ _load(ImlibImage * im, int load_data) if (im->frame_num != frame) break; ctx.pch_fctl = chunk; /* Remember fcTL location */ -#if IMLIB2_DEBUG - break; /* Show all frames */ -#else - goto scan_done; -#endif + break; #undef P case PNG_TYPE_IEND: