From 4918c0f94ea27cad1f5517869ef1fe459bedc293 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 16:06:24 +0100 Subject: [PATCH 1/2] Fix gif with no repeatcount (i.e. -1) not animating when loaded --- engine/src/image.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 65db673010c..74468c498f4 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -1736,9 +1736,11 @@ IO_stat MCImage::load(IO_handle stream, const char *version) if (ncolors > MAX_PLANES || flags & F_COMPRESSION || flags & F_TRUE_COLOR) { + repeatcount = -1; if (flags & F_REPEAT_COUNT) if ((stat = IO_read_int2(&repeatcount, stream)) != IO_NORMAL) return stat; + if ((stat = IO_read_uint4(&t_compressed->size, stream)) != IO_NORMAL) return stat; /* UNCHECKED */ MCMemoryAllocate(t_compressed->size, t_compressed->data); From f878d454953c1e06d9f2e90196aa11afd8a0c768 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Fri, 12 Apr 2013 16:24:27 +0100 Subject: [PATCH 2/2] Comment previous change --- engine/src/image.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/src/image.cpp b/engine/src/image.cpp index 74468c498f4..2a642ee36c4 100644 --- a/engine/src/image.cpp +++ b/engine/src/image.cpp @@ -1736,6 +1736,7 @@ IO_stat MCImage::load(IO_handle stream, const char *version) if (ncolors > MAX_PLANES || flags & F_COMPRESSION || flags & F_TRUE_COLOR) { + // IM-2013-04-12: [[ BZ 10843 ]] Initialize to -1 to indicate no repeat count has been set repeatcount = -1; if (flags & F_REPEAT_COUNT) if ((stat = IO_read_int2(&repeatcount, stream)) != IO_NORMAL)