Bug 516265 - GIF Decoder doesn't send close notifications if it never gets a size. r=joe

This commit is contained in:
Bobby Holley 2009-09-13 14:53:55 -04:00
parent c32d750749
commit c1225c588a
2 changed files with 4 additions and 1 deletions

View File

@ -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;
}
//******************************************************************************

View File

@ -114,6 +114,7 @@ private:
PRPackedBool mGIFOpen;
PRPackedBool mSawTransparency;
PRPackedBool mError;
PRPackedBool mEnded;
gif_struct mGIFStruct;
};