Bug 570451 - Avoid adding unneeded lines to image; r=joe sr=vlad
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 25 Jun 2010 15:20:18 -0400
changeset 46239 377f46f4d0002878e700baf756883fdc30bc0ba7
parent 46238 ae5c51c2ca9adf2bffed4720c77174d671d71f84
child 46240 25f90c23be30cbbd8371cca1db62be25df69e5c8
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, vlad
bugs570451
milestone1.9.3a6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 570451 - Avoid adding unneeded lines to image; r=joe sr=vlad
modules/libpr0n/decoders/png/nsPNGDecoder.cpp
--- a/modules/libpr0n/decoders/png/nsPNGDecoder.cpp
+++ b/modules/libpr0n/decoders/png/nsPNGDecoder.cpp
@@ -771,16 +771,19 @@ row_callback(png_structp png_ptr, png_by
    */
   nsPNGDecoder *decoder =
                static_cast<nsPNGDecoder*>(png_get_progressive_ptr(png_ptr));
 
   // skip this frame
   if (decoder->mFrameIsHidden)
     return;
 
+  if (row_num >= decoder->mFrameRect.height)
+    return;
+
   if (new_row) {
     PRInt32 width = decoder->mFrameRect.width;
     PRUint32 iwidth = decoder->mFrameRect.width;
 
     png_bytep line = new_row;
     if (decoder->interlacebuf) {
       line = decoder->interlacebuf + (row_num * decoder->mChannels * width);
       png_progressive_combine_row(png_ptr, line, new_row);