diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index b2e88bc9295e..19cca9bd4a94 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -3278,7 +3278,6 @@ RasterImage::IsDecodeFinished() // Precondition mDecodingMutex.AssertCurrentThreadOwns(); NS_ABORT_IF_FALSE(mDecoder, "Can't call IsDecodeFinished() without decoder!"); - MOZ_ASSERT(mDecodeRequest); // The decode is complete if we got what we wanted. if (mDecoder->IsSizeDecode()) { @@ -3288,11 +3287,12 @@ RasterImage::IsDecodeFinished() } else if (mDecoder->GetDecodeDone()) { return true; } - + // If the decoder returned because it needed a new frame and we haven't // written to it since then, the decoder may be storing data that it hasn't // decoded yet. - if (mDecoder->NeedsNewFrame() || mDecodeRequest->mAllocatedNewFrame) { + if (mDecoder->NeedsNewFrame() || + (mDecodeRequest && mDecodeRequest->mAllocatedNewFrame)) { return false; }