|
Lines 1-42
Link Here
|
| 1 |
$NetBSD: patch-writepng.c,v 1.1 2011/02/01 09:05:31 wiz Exp $ |
|
|
| 2 |
|
| 3 |
Fix build with png-1.5. |
| 4 |
|
| 5 |
--- writepng.c.orig 2009-06-12 20:58:50.000000000 +0000 |
| 6 |
+++ writepng.c |
| 7 |
@@ -240,6 +240,8 @@ void writepng(char *filename, |
| 8 |
double skewsin = sin(skew), skewcos = cos(skew); |
| 9 |
REAL minoverlay = 0, maxoverlay = 0; |
| 10 |
png_byte mask_byte; |
| 11 |
+ png_colorp palette = NULL; |
| 12 |
+ |
| 13 |
|
| 14 |
/* we must use direct color for translucent overlays */ |
| 15 |
if (overlay) |
| 16 |
@@ -309,7 +311,7 @@ void writepng(char *filename, |
| 17 |
} |
| 18 |
/* Set error handling. REQUIRED if you aren't supplying your own * |
| 19 |
* error hadnling functions in the png_create_write_struct() call. */ |
| 20 |
- if (setjmp(png_ptr->jmpbuf)) { |
| 21 |
+ if (setjmp(png_jmpbuf(png_ptr))) { |
| 22 |
/* If we get here, we had a problem reading the file */ |
| 23 |
fclose(fp); |
| 24 |
png_destroy_write_struct(&png_ptr, (png_infopp) NULL); |
| 25 |
@@ -334,8 +336,6 @@ void writepng(char *filename, |
| 26 |
PNG_INTERLACE_NONE, |
| 27 |
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); |
| 28 |
else { |
| 29 |
- png_colorp palette; |
| 30 |
- |
| 31 |
png_set_IHDR(png_ptr, info_ptr, width, height, 8 /* bit_depth */ , |
| 32 |
PNG_COLOR_TYPE_PALETTE, |
| 33 |
PNG_INTERLACE_NONE, |
| 34 |
@@ -434,7 +434,7 @@ void writepng(char *filename, |
| 35 |
png_write_end(png_ptr, info_ptr); |
| 36 |
|
| 37 |
/* if you malloced the palette, free it here */ |
| 38 |
- free(info_ptr->palette); |
| 39 |
+ free(palette); |
| 40 |
|
| 41 |
/* if you allocated any text comments, free them here */ |
| 42 |
|