Backed out changeset 76404bf85ef7 for landing with the wrong bug number in the commit message.

This commit is contained in:
Ryan VanderMeulen 2017-06-07 22:43:58 -04:00
parent 8e38408bd7
commit f6491af56c
2 changed files with 0 additions and 17 deletions

View File

@ -19,9 +19,7 @@
#include "nsRect.h"
#include "nspr.h"
#include "png.h"
#include "RasterImage.h"
#include "SurfaceCache.h"
#include "SurfacePipeFactory.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
@ -571,13 +569,6 @@ nsPNGDecoder::info_callback(png_structp png_ptr, png_infop info_ptr)
// Post our size to the superclass
decoder->PostSize(frameRect.width, frameRect.height);
if (width >
SurfaceCache::MaximumCapacity()/(bit_depth > 8 ? 16:8)) {
// libpng needs space to allocate two row buffers
png_error(decoder->mPNG, "Image is too wide");
}
if (decoder->HasError()) {
// Setting the size led to an error.
png_error(decoder->mPNG, "Sizing error");
@ -744,11 +735,6 @@ nsPNGDecoder::info_callback(png_structp png_ptr, png_infop info_ptr)
if (interlace_type == PNG_INTERLACE_ADAM7) {
if (frameRect.height < INT32_MAX / (frameRect.width * int32_t(channels))) {
const size_t bufferSize = channels * frameRect.width * frameRect.height;
if (bufferSize > SurfaceCache::MaximumCapacity()) {
png_error(decoder->mPNG, "Insufficient memory to deinterlace image");
}
decoder->interlacebuf = static_cast<uint8_t*>(malloc(bufferSize));
}
if (!decoder->interlacebuf) {

View File

@ -8,15 +8,12 @@
#define MOZ_EMBEDDED_LIBPNG
/* Limit image dimensions (bug #251381, #591822, #967656, and #1283961) */
#define PNG_USER_LIMITS_SUPPORTED
#ifndef MOZ_PNG_MAX_WIDTH
# define MOZ_PNG_MAX_WIDTH 0x7fffffffL /* Unlimited */
#endif
#ifndef MOZ_PNG_MAX_HEIGHT
# define MOZ_PNG_MAX_HEIGHT 0x7fffffffL /* Unlimited */
#endif
/* but allow nsPNGDecoder to override the limits (bug #1368407) */
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_API_RULE 0
#define PNG_COST_SHIFT 3