Bug 716140 - Don't use Gets on mImage from decoders.

This commit is contained in:
Joe Drew 2012-12-18 11:37:14 -05:00
parent 43a95f9f61
commit 3fbaeacc95
2 changed files with 7 additions and 9 deletions

View File

@ -219,9 +219,7 @@ nsresult nsGIFDecoder2::BeginImageFrame(uint16_t aDepth)
// Otherwise, the area may never be refreshed and the placeholder will remain
// on the screen. (Bug 37589)
if (mGIFStruct.y_offset > 0) {
int32_t imgWidth;
mImage.GetWidth(&imgWidth);
nsIntRect r(0, 0, imgWidth, mGIFStruct.y_offset);
nsIntRect r(0, 0, mGIFStruct.screen_width, mGIFStruct.y_offset);
PostInvalidation(r);
}
}

View File

@ -105,14 +105,14 @@ void nsPNGDecoder::CreateFrame(png_uint_32 x_offset, png_uint_32 y_offset,
mFrameRect.width = width;
mFrameRect.height = height;
// Tell the superclass we're starting a frame
PostFrameStart();
#ifdef PNG_APNG_SUPPORTED
if (png_get_valid(mPNG, mInfo, PNG_INFO_acTL))
SetAnimFrameInfo();
#endif
// Tell the superclass we're starting a frame
PostFrameStart();
PR_LOG(GetPNGDecoderAccountingLog(), PR_LOG_DEBUG,
("PNGDecoderAccounting: nsPNGDecoder::CreateFrame -- created "
"image frame with %dx%d pixels in container %p",
@ -149,7 +149,7 @@ void nsPNGDecoder::SetAnimFrameInfo()
(static_cast<double>(delay_num) * 1000 / delay_den);
}
uint32_t numFrames = mImage.GetNumFrames();
uint32_t numFrames = GetFrameCount();
mImage.SetFrameTimeout(numFrames - 1, timeout);
@ -178,7 +178,7 @@ void nsPNGDecoder::EndImageFrame()
uint32_t numFrames = 1;
#ifdef PNG_APNG_SUPPORTED
numFrames = mImage.GetNumFrames();
numFrames = GetFrameCount();
// We can't use mPNG->num_frames_read as it may be one ahead.
if (numFrames > 1) {
@ -790,7 +790,7 @@ nsPNGDecoder::row_callback(png_structp png_ptr, png_bytep new_row,
if (!rowHasNoAlpha)
decoder->mFrameHasNoAlpha = false;
uint32_t numFrames = decoder->mImage.GetNumFrames();
uint32_t numFrames = decoder->GetFrameCount();
if (numFrames <= 1) {
// Only do incremental image display for the first frame
// XXXbholley - this check should be handled in the superclass