]>
Commit | Line | Data |
---|---|---|
f678ef3d ER |
1 | http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/www/amaya/patches/patch-ae?rev=1.12;content-type=text/plain |
2 | ||
3 | $NetBSD: patch-ae,v 1.12 2011/07/02 22:19:30 dholland Exp $ | |
4 | ||
5 | - Don't use the png library to free twice. | |
6 | - Fix build with recent libpng. | |
7 | ||
8 | --- Amaya/thotlib/image/pnghandler.c.orig 2009-09-09 09:54:50.000000000 +0000 | |
9 | +++ Amaya/thotlib/image/pnghandler.c | |
10 | @@ -128,7 +128,7 @@ static unsigned char *ReadPng (FILE *pfF | |
11 | png_byte **ppbRowPointers; | |
12 | unsigned char *pixels; | |
13 | unsigned int i, j, passes; | |
14 | - unsigned long lw, lh; | |
15 | + unsigned lw, lh; | |
16 | int iBitDepth, iColorType; | |
17 | double dGamma; | |
18 | ||
19 | @@ -149,7 +149,7 @@ static unsigned char *ReadPng (FILE *pfF | |
20 | png_destroy_read_struct (&png_ptr, NULL, NULL); | |
21 | return NULL; | |
22 | } | |
23 | - if (setjmp (png_ptr->jmpbuf)) | |
24 | + if (setjmp (png_jmpbuf(png_ptr))) | |
25 | { | |
26 | /* Free all of the memory associated with the png_ptr and info_ptr */ | |
27 | png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); | |
28 | @@ -175,7 +175,7 @@ static unsigned char *ReadPng (FILE *pfF | |
29 | png_set_palette_to_rgb (png_ptr); | |
30 | /* 8 bits / channel is needed */ | |
31 | if (iColorType == PNG_COLOR_TYPE_GRAY && iBitDepth < 8) | |
32 | - png_set_gray_1_2_4_to_8(png_ptr); | |
33 | + png_set_expand_gray_1_2_4_to_8(png_ptr); | |
34 | /* all transparency type : 1 color, indexed => alpha channel*/ | |
35 | if (png_get_valid (png_ptr, info_ptr,PNG_INFO_tRNS)) | |
36 | png_set_tRNS_to_alpha (png_ptr); | |
37 | @@ -588,7 +588,7 @@ static unsigned char *ReadPng (FILE *inf | |
38 | } | |
39 | ||
40 | /* clean up after the read, and free any memory allocated */ | |
41 | - png_read_destroy (png_ptr, info_ptr, (png_info*) NULL); | |
42 | + //png_read_destroy (png_ptr, info_ptr, (png_info*) NULL); | |
43 | /* Free all of the memory associated with the png_ptr and info_ptr */ | |
44 | png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); | |
45 | /* free the structures */ | |
46 | @@ -858,7 +858,7 @@ ThotBool SavePng (const char *filename, | |
47 | png_destroy_write_struct(&png, (png_infopp) NULL); | |
48 | return FALSE; | |
49 | } | |
50 | - if (setjmp(png->jmpbuf)) | |
51 | + if (setjmp(png_jmpbuf(png))) | |
52 | { | |
53 | png_destroy_write_struct(&png, &pngInfo); | |
54 | TtaWriteClose (pngFile); |