Bug 1063084 - BMP with compression can be transparent. r=seth

This commit is contained in:
Benoit Girard 2014-09-04 16:08:33 -04:00
parent 3f1edc2c3a
commit 26e2c0e96e

View File

@ -742,6 +742,9 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, uint32_t aCount, DecodeStrategy
byte = *aBuffer++;
aCount--;
mCurPos += byte;
// Delta encoding makes it possible to skip pixels making
// the image transparent.
mUseAlphaData = mHaveAlphaData = true;
if (mCurPos > mBIH.width)
mCurPos = mBIH.width;
@ -753,6 +756,9 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, uint32_t aCount, DecodeStrategy
byte = *aBuffer++;
aCount--;
mState = eRLEStateInitial;
// Delta encoding makes it possible to skip pixels making
// the image transparent.
mUseAlphaData = mHaveAlphaData = true;
mCurLine -= std::min<int32_t>(byte, mCurLine);
break;