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
46
47
48
49
50
51
52
|
$NetBSD: patch-ac,v 1.4 2013/02/16 11:22:16 wiz Exp $
Fix build with png-1.6.
--- libs/auxfun/image.cpp.orig 2008-05-02 06:56:04.000000000 +0000
+++ libs/auxfun/image.cpp
@@ -7,6 +7,7 @@
#include <zlib.h>
#include <png.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <math.h>
@@ -94,7 +95,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 +158,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 +215,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 +274,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);
|