Bug 719202 - Innocuous uninitialized BMP header value. r=joe

This commit is contained in:
Brian R. Bondy 2012-01-23 18:28:58 -05:00
parent 821eb101a0
commit b8f1a573ae

View File

@ -426,7 +426,8 @@ nsBMPDecoder::WriteInternal(const char* aBuffer, PRUint32 aCount)
aBuffer += toCopy;
aCount -= toCopy;
}
if (mBIH.compression == BI_BITFIELDS && mPos == WIN_HEADER_LENGTH + BITFIELD_LENGTH) {
if (mPos == WIN_HEADER_LENGTH + BITFIELD_LENGTH &&
mBIH.compression == BI_BITFIELDS) {
mBitFields.red = LITTLE_TO_NATIVE32(*(PRUint32*)mRawBuf);
mBitFields.green = LITTLE_TO_NATIVE32(*(PRUint32*)(mRawBuf + 4));
mBitFields.blue = LITTLE_TO_NATIVE32(*(PRUint32*)(mRawBuf + 8));