From c1225c588af7b46ad196c92d99d1b926a6ccb839 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Sun, 13 Sep 2009 14:53:55 -0400 Subject: [PATCH] Bug 516265 - GIF Decoder doesn't send close notifications if it never gets a size. r=joe --- modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp | 4 +++- modules/libpr0n/decoders/gif/nsGIFDecoder2.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp index 2b88d0f6b55c..c6acf4a6930e 100644 --- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp +++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp @@ -122,6 +122,7 @@ nsGIFDecoder2::nsGIFDecoder2() , mGIFOpen(PR_FALSE) , mSawTransparency(PR_FALSE) , mError(PR_FALSE) + , mEnded(PR_FALSE) { // Clear out the structure, excluding the arrays memset(&mGIFStruct, 0, sizeof(mGIFStruct)); @@ -338,7 +339,7 @@ void nsGIFDecoder2::BeginGIF() //****************************************************************************** void nsGIFDecoder2::EndGIF(PRBool aSuccess) { - if (!mGIFOpen) + if (mEnded) return; if (aSuccess) @@ -353,6 +354,7 @@ void nsGIFDecoder2::EndGIF(PRBool aSuccess) mImageContainer->SetLoopCount(mGIFStruct.loop_count); mGIFOpen = PR_FALSE; + mEnded = PR_TRUE; } //****************************************************************************** diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h index 186bc607cda4..8e0c328cf82e 100644 --- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h +++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h @@ -114,6 +114,7 @@ private: PRPackedBool mGIFOpen; PRPackedBool mSawTransparency; PRPackedBool mError; + PRPackedBool mEnded; gif_struct mGIFStruct; };