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
43
44
45
|
$NetBSD: patch-aa,v 1.6 2011/01/14 10:37:22 wiz Exp $
Fix build with png-1.5.
--- png.c.orig 2008-08-18 01:14:38.000000000 +0000
+++ png.c
@@ -48,7 +48,11 @@ void img_my_png_warning(png_structp a, p
/* Error for from-web PNG images. */
void img_my_png_error(png_structp png_ptr, png_const_charp error_string)
{
+#if (PNG_LIBPNG_VER < 10500)
longjmp(png_ptr->jmpbuf,1);
+#else
+ png_longjmp(png_ptr,1);
+#endif
}
void png_info_callback(png_structp png_ptr, png_infop info_ptr)
@@ -204,7 +208,7 @@ void png_start(struct cached_image *cimg
#ifdef DEBUG
if (!info_ptr) internal ("png_create_info_struct failed\n");
#endif /* #ifdef DEBUG */
- if (setjmp(png_ptr->jmpbuf)){
+ if (setjmp(png_jmpbuf(png_ptr))){
error:
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
@@ -214,7 +218,7 @@ error:
png_set_progressive_read_fn(png_ptr, NULL,
png_info_callback, png_row_callback,
png_end_callback);
- if (setjmp(png_ptr->jmpbuf)) goto error;
+ if (setjmp(png_jmpbuf(png_ptr))) goto error;
decoder=mem_alloc(sizeof(*decoder));
decoder->png_ptr=png_ptr;
decoder->info_ptr=info_ptr;
@@ -233,7 +237,7 @@ void png_restart(struct cached_image *ci
png_ptr=((struct png_decoder *)(cimg->decoder))->png_ptr;
info_ptr=((struct png_decoder *)(cimg->decoder))->info_ptr;
end_callback_hit=0;
- if (setjmp(png_ptr->jmpbuf)){
+ if (setjmp(png_jmpbuf(png_ptr))){
img_end(cimg);
return;
}
|