diff options
author | Steve Block <steveblock@google.com> | 2010-07-08 12:51:48 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-07-09 15:33:40 +0100 |
commit | ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24 (patch) | |
tree | bb45155550ec013adc0ad10f4d7d354c6469b022 /WebCore/platform/image-decoders | |
parent | d4b24d9a829ed7de70381c8b99fb75a07ab40466 (diff) | |
download | external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.zip external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.tar.gz external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.tar.bz2 |
Merge WebKit at r62496: Initial merge by git
Change-Id: Ie3da0770eca22a70a632e3571f31cfabc80facb2
Diffstat (limited to 'WebCore/platform/image-decoders')
-rw-r--r-- | WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/image-decoders/png/PNGImageDecoder.cpp | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index cce4f64..4911bc9 100644 --- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp @@ -210,7 +210,7 @@ public: // We can fill in the size now that the header is available. if (!m_decoder->setSize(m_info.image_width, m_info.image_height)) - return m_decoder->setFailed(); + return false; if (m_decodingSizeOnly) { // We can stop here. Reduce our buffer length and available diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp index 56cf05f..8186f33 100644 --- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp +++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp @@ -41,6 +41,12 @@ #include "PNGImageDecoder.h" #include "png.h" +#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4)) +#define JMPBUF(png_ptr) png_jmpbuf(png_ptr) +#else +#define JMPBUF(png_ptr) png_ptr->jmpbuf +#endif + namespace WebCore { // Gamma constants. @@ -54,7 +60,7 @@ const unsigned long cMaxPNGSize = 1000000UL; // Called if the decoding of the image fails. static void PNGAPI decodingFailed(png_structp png, png_const_charp) { - longjmp(png->jmpbuf, 1); + longjmp(JMPBUF(png), 1); } // Callbacks given to the read struct. The first is for warnings (we want to @@ -125,7 +131,7 @@ public: PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png)); // We need to do the setjmp here. Otherwise bad things will happen. - if (setjmp(m_png->jmpbuf)) + if (setjmp(JMPBUF(m_png))) return decoder->setFailed(); const char* segment; @@ -220,7 +226,7 @@ void PNGImageDecoder::headerAvailable() // Protect against large images. if (png->width > cMaxPNGSize || png->height > cMaxPNGSize) { - longjmp(png->jmpbuf, 1); + longjmp(JMPBUF(png), 1); return; } @@ -233,7 +239,7 @@ void PNGImageDecoder::headerAvailable() bool result = setSize(width, height); m_doNothingOnFailure = false; if (!result) { - longjmp(png->jmpbuf, 1); + longjmp(JMPBUF(png), 1); return; } @@ -297,7 +303,7 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, RGBA32Buffer& buffer = m_frameBufferCache[0]; if (buffer.status() == RGBA32Buffer::FrameEmpty) { if (!buffer.setSize(scaledSize().width(), scaledSize().height())) { - longjmp(m_reader->pngPtr()->jmpbuf, 1); + longjmp(JMPBUF(m_reader->pngPtr()), 1); return; } buffer.setStatus(RGBA32Buffer::FramePartial); |