From 5dbc0f7d58ffa0dcac041a28a3f8bb88e2ab30db Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 15 Oct 2015 17:35:21 -0700 Subject: [PATCH] Bug 1215361 (part 1) - Don't set mBPP twice in nsICODecoder.cpp. r=seth. Seth's "XXX" comment is correct. --- image/decoders/nsICODecoder.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp index 42472b4371a..121e425ce9f 100644 --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp @@ -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)) {