Bug 1215361 (part 1) - Don't set mBPP twice in nsICODecoder.cpp. r=seth.

Seth's "XXX" comment is correct.
This commit is contained in:
Nicholas Nethercote 2015-10-15 17:35:21 -07:00
parent f7ec3dff73
commit 5dbc0f7d58

View File

@ -390,7 +390,7 @@ nsICODecoder::ReadBIH(const char* aData)
// Buffer the rest of the bitmap information header.
memcpy(mBIHraw + PNGSIGNATURESIZE, aData, BITMAPINFOSIZE - PNGSIGNATURESIZE);
// Extracting the BPP from the BIH header; it should be trusted over the one
// Extract the BPP from the BIH header; it should be trusted over the one
// we have from the ICO header.
mBPP = ReadBPP(mBIHraw);
@ -437,12 +437,6 @@ nsICODecoder::ReadBIH(const char* aData)
return Transition::Terminate(ICOState::FAILURE);
}
// Sometimes the ICO BPP header field is not filled out so we should trust the
// contained resource over our own information.
// XXX(seth): Is this ever different than the value we obtained from
// ReadBPP() above?
mBPP = bmpDecoder->GetBitsPerPixel();
// Check to make sure we have valid color settings.
uint16_t numColors = GetNumColors();
if (numColors == uint16_t(-1)) {