summarylogtreecommitdiffstats
path: root/xulrunner-png15.patch
diff options
context:
space:
mode:
Diffstat (limited to 'xulrunner-png15.patch')
-rw-r--r--xulrunner-png15.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/xulrunner-png15.patch b/xulrunner-png15.patch
new file mode 100644
index 000000000000..cf3a7454c96b
--- /dev/null
+++ b/xulrunner-png15.patch
@@ -0,0 +1,83 @@
+--- modules/libpr0n/decoders/png/nsPNGDecoder.cpp.orig 2011-03-03 11:42:44.000000000 +0000
++++ modules/libpr0n/decoders/png/nsPNGDecoder.cpp 2011-04-17 19:22:15.597110133 +0100
+@@ -116,7 +116,7 @@
+ nsresult rv = mImage->AppendFrame(x_offset, y_offset, width, height, format,
+ &mImageData, &imageDataLength);
+ if (NS_FAILED(rv))
+- longjmp(mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY
++ longjmp(png_jmpbuf(mPNG), 5); // NS_ERROR_OUT_OF_MEMORY
+
+ mFrameRect.x = x_offset;
+ mFrameRect.y = y_offset;
+@@ -371,7 +371,7 @@
+ }
+
+ // we need to do the setjmp here otherwise bad things will happen
+- if (setjmp(decoder->mPNG->jmpbuf)) {
++ if (setjmp(png_jmpbuf(decoder->mPNG))) {
+ png_destroy_read_struct(&decoder->mPNG, &decoder->mInfo, NULL);
+
+ decoder->mError = PR_TRUE;
+@@ -438,7 +438,8 @@
+ // First try to see if iCCP chunk is present
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_iCCP)) {
+ png_uint_32 profileLen;
+- char *profileData, *profileName;
++ png_bytep profileData;
++ png_charp profileName;
+ int compression;
+
+ png_get_iCCP(png_ptr, info_ptr, &profileName, &compression,
+@@ -546,7 +547,7 @@
+ /* limit image dimensions (bug #251381) */
+ #define MOZ_PNG_MAX_DIMENSION 1000000L
+ if (width > MOZ_PNG_MAX_DIMENSION || height > MOZ_PNG_MAX_DIMENSION)
+- longjmp(decoder->mPNG->jmpbuf, 1);
++ longjmp(png_jmpbuf(decoder->mPNG), 1);
+ #undef MOZ_PNG_MAX_DIMENSION
+
+ if (color_type == PNG_COLOR_TYPE_PALETTE)
+@@ -662,7 +663,7 @@
+ // the image hasn't been inited yet
+ decoder->mImage->Init(width, height, decoder->mObserver);
+ } else if (containerWidth != PRInt32(width) || containerHeight != PRInt32(height)) {
+- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_UNEXPECTED
++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_UNEXPECTED
+ }
+
+ if (decoder->mObserver)
+@@ -688,14 +689,14 @@
+ decoder->mCMSLine =
+ (PRUint8 *)nsMemory::Alloc(bpp[channels] * width);
+ if (!decoder->mCMSLine)
+- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY
++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY
+ }
+
+ if (interlace_type == PNG_INTERLACE_ADAM7) {
+ if (height < PR_INT32_MAX / (width * channels))
+ decoder->interlacebuf = (PRUint8 *)nsMemory::Alloc(channels * width * height);
+ if (!decoder->interlacebuf) {
+- longjmp(decoder->mPNG->jmpbuf, 5); // NS_ERROR_OUT_OF_MEMORY
++ longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY
+ }
+ }
+
+@@ -717,7 +718,7 @@
+ * successfully decoded) before bailing, but it's simpler to just bail
+ * out with an error message.
+ */
+- png_set_crc_action(png_ptr, NULL, PNG_CRC_ERROR_QUIT);
++ png_set_crc_action(png_ptr, PNG_CRC_NO_CHANGE, PNG_CRC_ERROR_QUIT);
+
+ return;
+ }
+@@ -915,7 +916,7 @@
+ error_callback(png_structp png_ptr, png_const_charp error_msg)
+ {
+ PR_LOG(gPNGLog, PR_LOG_ERROR, ("libpng error: %s\n", error_msg));
+- longjmp(png_ptr->jmpbuf, 1);
++ longjmp(png_jmpbuf(png_ptr), 1);
+ }
+
+