Bug 222176 - Animated GIF loops 1 time too many (additional patch); r,a=joe
authorMax Stepin <newstop@gmail.com>
Sun, 23 Jan 2011 23:29:32 -0500
changeset 61163 6149b3a93e1b2f436601bb3375ff8620137eaa0f
parent 61162 afe951130c656a404cce775b78a89992086b5d25
child 61164 4e57b18dd908c3537f1497fe6f7d0c28e8f7a6c6
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs222176
milestone2.0b10pre
Bug 222176 - Animated GIF loops 1 time too many (additional patch); r,a=joe
modules/libpr0n/decoders/nsGIFDecoder2.cpp
--- a/modules/libpr0n/decoders/nsGIFDecoder2.cpp
+++ b/modules/libpr0n/decoders/nsGIFDecoder2.cpp
@@ -116,16 +116,19 @@ nsGIFDecoder2::nsGIFDecoder2()
   , mCurrentPass(0)
   , mLastFlushedPass(0)
   , mGIFOpen(PR_FALSE)
   , mSawTransparency(PR_FALSE)
 {
   // Clear out the structure, excluding the arrays
   memset(&mGIFStruct, 0, sizeof(mGIFStruct));
 
+  // Initialize as "animate once" in case no NETSCAPE2.0 extension is found
+  mGIFStruct.loop_count = 1;
+
   // Start with the version (GIF89a|GIF87a)
   mGIFStruct.state = gif_type;
   mGIFStruct.bytes_to_consume = 6;
 }
 
 nsGIFDecoder2::~nsGIFDecoder2()
 {
   if (mGIFStruct.local_colormap) {