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
|
$NetBSD: patch-ac,v 1.3 2011/01/20 16:48:11 wiz Exp $
Fix build with png-1.5.
--- libs/auxfun/image.cpp.orig 2008-05-02 06:56:04.000000000 +0000
+++ libs/auxfun/image.cpp
@@ -94,7 +94,7 @@ bool Image::LoadPNG ()
png_init_io (png, file);
- if (setjmp (png->jmpbuf))
+ if (setjmp (png_jmpbuf(png)))
// If we get here, we had a problem reading the file
goto nomem;
@@ -157,7 +157,7 @@ bool Image::LoadPNG ()
row_pointers = new png_bytep [Height];
if (!row_pointers
- || setjmp (png->jmpbuf)) // Set a new exception handler
+ || setjmp (png_jmpbuf(png))) // Set a new exception handler
{
delete [] row_pointers;
nomem:
@@ -214,7 +214,7 @@ bool Image::SavePNG (const char *fName)
}
/* Catch processing errors */
- if (setjmp(png->jmpbuf))
+ if (setjmp(png_jmpbuf(png)))
/* If we get here, we had a problem writing the file */
goto error2;
@@ -273,10 +273,6 @@ bool Image::SavePNG (const char *fName)
/* It is REQUIRED to call this to finish writing the rest of the file */
png_write_end (png, info);
- /* if you malloced the palette, free it here */
- if (info->palette)
- free (info->palette);
-
/* clean up after the write, and free any memory allocated */
png_destroy_write_struct (&png, &info);
|