# HG changeset patch # User Timothy Nikkel # Parent 0e5e012ca28549fb00b1125fcaf3f6693ebf72e3 Bug 1242093. diff --git a/image/decoders/nsBMPDecoder.cpp b/image/decoders/nsBMPDecoder.cpp --- a/image/decoders/nsBMPDecoder.cpp +++ b/image/decoders/nsBMPDecoder.cpp @@ -969,17 +969,17 @@ nsBMPDecoder::ReadRLESegment(const char* LexerTransition nsBMPDecoder::ReadRLEDelta(const char* aData) { // Delta encoding makes it possible to skip pixels making part of the image // transparent. MOZ_ASSERT(mMayHaveTransparency); mDoesHaveTransparency = true; - if (mDownscaler) { + if (mDownscaler && mCurrentPos < mH.mWidth) { // Clear the skipped pixels. (This clears to the end of the row, // which is perfect if there's a Y delta and harmless if not). mDownscaler->ClearRow(/* aStartingAtCol = */ mCurrentPos); } // Handle the XDelta. mCurrentPos += uint8_t(aData[0]); if (mCurrentPos > mH.mWidth) {