Bug 863958 - Don't call SetSize from the ICO decoder if we already have the size. r=seth a=akeybl
authorJoe Drew <joe@drew.ca>
Thu, 25 Apr 2013 16:34:30 -0400
changeset 133540 9b664bf6ac2a75c32b60df97a5c32b27b216313a
parent 133539 93ff2a7991fde0e2dc1398278ca8b9f5d39c1c6d
child 133541 755dc68138b6a5aef203aab3374cfcbf07f86c76
push id3697
push userjdrew@mozilla.com
push dateTue, 30 Apr 2013 00:17:46 +0000
treeherdermozilla-aurora@9b664bf6ac2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth, akeybl
bugs863958
milestone22.0a2
Bug 863958 - Don't call SetSize from the ICO decoder if we already have the size. r=seth a=akeybl
image/decoders/nsICODecoder.cpp
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -336,17 +336,17 @@ nsICODecoder::WriteInternal(const char* 
   }
 
   // If we have a PNG, let the PNG decoder do all of the rest of the work
   if (mIsPNG && mContainedDecoder && mPos >= mImageOffset + PNGSIGNATURESIZE) {
     if (!WriteToContainedDecoder(aBuffer, aCount)) {
       return;
     }
 
-    if (mContainedDecoder->HasSize()) {
+    if (!HasSize() && mContainedDecoder->HasSize()) {
       PostSize(mContainedDecoder->GetImageMetadata().GetWidth(),
                mContainedDecoder->GetImageMetadata().GetHeight());
     }
 
     mPos += aCount;
     aBuffer += aCount;
     aCount = 0;