# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/imlib2/hotfix-big-endian.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- The PNG_TYPE_* constants are built in little-endian byte order, but chunk->hdr.type was compared raw. On big-endian (e.g. sparc64) no chunk type matched, so APNG handling and the IEND exit were never taken. Convert with SWAP_LE_32 like the ANI loader does. Signed-off-by: René Rebe --- --- a/src/modules/loaders/loader_png.c +++ b/src/modules/loaders/loader_png.c @@ -352,7 +352,7 @@ _load(ImlibImage *im, int load_data) if (!mm_check(fptr + len)) break; - switch (chunk->hdr.type) + switch (SWAP_LE_32(chunk->hdr.type)) { case PNG_TYPE_IDAT: DL("\n"); @@ -444,7 +444,7 @@ _load(ImlibImage *im, int load_data) if (!mm_check(fptr + len)) break; - switch (chunk->hdr.type) + switch (SWAP_LE_32(chunk->hdr.type)) { case PNG_TYPE_IHDR: #define P (&chunk->ihdr) @@ -560,7 +560,7 @@ _load(ImlibImage *im, int load_data) png_process_data(png_ptr, info_ptr, fptr, len + 12); - if (chunk->hdr.type == PNG_TYPE_IEND) + if (SWAP_LE_32(chunk->hdr.type) == PNG_TYPE_IEND) break; }