1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
From: Austin Donnelly <and1000@debian.org>
Subject: Check libpng version and call right function
--- a/png.c
+++ b/png.c
@@ -75,7 +75,11 @@ static void output_error(png_structp png
{
debug(" #error ");
output_warn( png_ptr, str);
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ longjmp(png_jmpbuf((png_ptr)),1);
+#else
longjmp(png_ptr->jmpbuf, 1); /* return control to outer routine */
+#endif
}
@@ -164,7 +168,11 @@ static int pngHeader(png_structpp png_pp
png_destroy_read_struct(png_pp, info_pp, end_pp);
return 0;
}
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ if (setjmp(png_jmpbuf(*png_pp))) {
+#else
if (setjmp((*png_pp)->jmpbuf)) {
+#endif
/* On error */
png_destroy_read_struct(png_pp, info_pp, end_pp);
return 0;
@@ -220,7 +228,12 @@ int pngIdent(char *fullname, char *name)
zclose(zinput_file);
return 0;
}
+
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ if (setjmp(png_jmpbuf(png_ptr))) {
+#else
if (setjmp(png_ptr->jmpbuf)) {
+#endif
/* On error */
freeImage(image);
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
|