Bug 863958 - Don't call SetSize from the ICO decoder if we already have the size. r=seth
authorJoe Drew <joe@drew.ca>
Thu, 25 Apr 2013 16:34:30 -0400
changeset 129966 8658d3607e1aaaadcb02b18ffac3210c8b3dd620
parent 129965 104d4a16aac8da36022b47ba3812a7c5518ed85a
child 129967 506e1fb34b3018f27eaa25cc40ceb7fa906b7d2e
push id1552
push userttaubert@mozilla.com
push dateSat, 27 Apr 2013 15:33:29 +0000
treeherderfx-team@40dafc376794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs863958
milestone23.0a1
Bug 863958 - Don't call SetSize from the ICO decoder if we already have the size. r=seth
image/decoders/nsICODecoder.cpp
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -344,17 +344,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;