mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 685471 - In PNG decoder, the allocating of mHeaderBuf can be prevented. (followup) r=joe@drew.ca
This commit is contained in:
parent
e0c75c54ed
commit
f6f5713fa6
@ -287,7 +287,7 @@ nsPNGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
|
||||
return;
|
||||
|
||||
// Scan the header for the width and height bytes
|
||||
PRUint32 pos = 0;
|
||||
uint32_t pos = 0;
|
||||
const uint8_t *bptr = (uint8_t *)aBuffer;
|
||||
|
||||
while (pos < aCount && mHeaderBytesRead < BYTES_NEEDED_FOR_DIMENSIONS) {
|
||||
@ -312,8 +312,8 @@ nsPNGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
|
||||
if (mHeaderBytesRead == BYTES_NEEDED_FOR_DIMENSIONS) {
|
||||
|
||||
// Grab the width and height, accounting for endianness (thanks libpng!)
|
||||
PRUint32 width = png_get_uint_32(mSizeBytes);
|
||||
PRUint32 height = png_get_uint_32(mSizeBytes + 4);
|
||||
uint32_t width = png_get_uint_32(mSizeBytes);
|
||||
uint32_t height = png_get_uint_32(mSizeBytes + 4);
|
||||
|
||||
// Too big?
|
||||
if ((width > MOZ_PNG_MAX_DIMENSION) || (height > MOZ_PNG_MAX_DIMENSION)) {
|
||||
|
@ -79,8 +79,8 @@ public:
|
||||
gfxASurface::gfxImageFormat format;
|
||||
|
||||
// For size decodes
|
||||
PRUint8 mSizeBytes[8]; // Space for width and height, both 4 bytes
|
||||
PRUint32 mHeaderBytesRead;
|
||||
uint8_t mSizeBytes[8]; // Space for width and height, both 4 bytes
|
||||
uint32_t mHeaderBytesRead;
|
||||
|
||||
// whether CMS or premultiplied alpha are forced off
|
||||
uint32_t mCMSMode;
|
||||
|
Loading…
Reference in New Issue
Block a user