summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/abiword-use-proper-png-api.patch
blob: e8ce02899dbcca15106d11d3e7a4774e41fe7d57 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
Do not directly access the fields of png_struct and png_info.

--- a/plugins/mswrite/xp/ie_imp_MSWrite.cpp	2010-05-30 21:20:53.000000000 +0200
+++ b/plugins/mswrite/xp/ie_imp_MSWrite.cpp	2014-09-07 06:58:04.162298089 +0200
@@ -891,7 +891,7 @@
 		info_ptr = png_create_info_struct (png_ptr);
 		if (!info_ptr) goto err;
 		
-		if (setjmp (png_ptr->jmpbuf) ) {
+		if (setjmp (png_jmpbuf(png_ptr)) ) {
 			png_destroy_write_struct (&png_ptr, &info_ptr);
 			goto err;
 		}

--- a/src/af/gr/win/gr_Win32Image.cpp	2009-07-08 19:33:53.000000000 +0200
+++ b/src/af/gr/win/gr_Win32Image.cpp	2014-09-07 06:58:04.198298090 +0200
@@ -148,7 +148,7 @@
 	info_ptr = png_create_info_struct(png_ptr);
 
 	// libpng will longjmp back to here if a fatal error occurs
-	if (setjmp(png_ptr->jmpbuf))
+	if (setjmp(png_jmpbuf(png_ptr)))
 	{
 		/* If we get here, we had a problem reading the file */
 		png_destroy_write_struct(&png_ptr,  (png_infopp)NULL);
@@ -547,7 +547,7 @@
 	 * the normal method of doing things with libpng).  REQUIRED unless you
 	 * set up your own error handlers in the png_create_read_struct() earlier.
 	 */
-	if (setjmp(png_ptr->jmpbuf))
+	if (setjmp(png_jmpbuf(png_ptr)))
 	{
 		/* Free all of the memory associated with the png_ptr and info_ptr */
 		png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);

--- a/src/af/util/xp/ut_png.cpp	2008-02-24 04:33:07.000000000 +0100
+++ b/src/af/util/xp/ut_png.cpp	2014-09-07 06:58:04.230298091 +0200
@@ -71,7 +71,7 @@
 	 * the normal method of doing things with libpng).  REQUIRED unless you
 	 * set up your own error handlers in the png_create_read_struct() earlier.
 	 */
-	if (setjmp(png_ptr->jmpbuf))
+	if (setjmp(png_jmpbuf(png_ptr)))
 	{
 		/* Free all of the memory associated with the png_ptr and info_ptr */
 		png_destroy_read_struct(&png_ptr, &info_ptr, static_cast<png_infopp>(NULL));

--- a/plugins/bmp/xp/ie_impGraphic_BMP.cpp	2009-06-25 06:02:06.000000000 +0200
+++ b/plugins/bmp/xp/ie_impGraphic_BMP.cpp	2014-09-07 06:59:08.814300205 +0200
@@ -313,7 +313,7 @@
 	 * the normal method of doing things with libpng).  REQUIRED unless you
 	 * set up your own error handlers in the png_create_read_struct() earlier.
 	 */
-	if (setjmp(m_pPNG->jmpbuf))
+	if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		/* Free all of the memory associated with the png_ptr and info_ptr */
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
@@ -332,7 +332,7 @@
 	UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB)
 	{
 		/* Reset error handling for libpng */
-		if (setjmp(m_pPNG->jmpbuf))
+		if (setjmp(png_jmpbuf(m_pPNG)))
 		{
 			png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
 			return UT_ERROR;
@@ -372,7 +372,7 @@
 UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB)
 {
 	/* Reset error handling for libpng */
-	if (setjmp(m_pPNG->jmpbuf))
+	if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
 		return UT_ERROR;

--- a/plugins/rsvg/xp/AbiRSVG.cpp	2009-06-25 06:02:06.000000000 +0200
+++ b/plugins/rsvg/xp/AbiRSVG.cpp	2014-09-07 06:59:08.914300209 +0200
@@ -145,7 +145,7 @@
 				return error;
 			}
 		
-		if (setjmp(m_pPNG->jmpbuf))
+		if (setjmp(png_jmpbuf(m_pPNG)))
 			{
 				g_object_unref(G_OBJECT(pixbuf));
 				png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
@@ -234,7 +234,7 @@
 		 * the normal method of doing things with libpng).  REQUIRED unless you
 		 * set up your own error handlers in the png_create_read_struct() earlier.
 		 */
-		if (setjmp(m_pPNG->jmpbuf))
+		if (setjmp(png_jmpbuf(m_pPNG)))
 			{
 				/* Free all of the memory associated with the png_ptr and info_ptr */
 				png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);

--- a/src/wp/impexp/win/ie_impGraphic_Win32Native.cpp	2009-07-07 18:50:18.000000000 +0200
+++ b/src/wp/impexp/win/ie_impGraphic_Win32Native.cpp	2014-09-07 06:59:09.018300212 +0200
@@ -501,7 +501,7 @@
      * the normal method of doing things with libpng).  REQUIRED unless you
      * set up your own error handlers in the png_create_read_struct() earlier.
      */
-    if (setjmp(m_pPNG->jmpbuf))
+    if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		/* Free all of the memory associated with the png_ptr and info_ptr */
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
@@ -520,7 +520,7 @@
 UT_Error IE_ImpGraphic_Win32Native::Convert_BMP_Palette(UT_ByteBuf* pBB)
 {
     /* Reset error handling for libpng */
-    if (setjmp(m_pPNG->jmpbuf))
+    if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
 		return UT_ERROR;
@@ -560,7 +560,7 @@
 UT_Error IE_ImpGraphic_Win32Native::Convert_BMP(UT_ByteBuf* pBB)
 {
     /* Reset error handling for libpng */
-    if (setjmp(m_pPNG->jmpbuf))
+    if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
 		return UT_ERROR;

--- a/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp	2009-07-01 06:02:04.000000000 +0200
+++ b/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp	2014-09-07 06:59:09.138300216 +0200
@@ -185,7 +185,7 @@
 /** needed for the stejmp context */
 UT_Error IE_ImpGraphic_GdkPixbuf::_png_write(GdkPixbuf * pixbuf)
 {
-	if (setjmp(m_pPNG->jmpbuf))
+	if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		DELETEP(m_pPngBB);
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
@@ -446,7 +446,7 @@
 	 * the normal method of doing things with libpng).  REQUIRED unless you
 	 * set up your own error handlers in the png_create_read_struct() earlier.
 	 */
-	if (setjmp(m_pPNG->jmpbuf))
+	if (setjmp(png_jmpbuf(m_pPNG)))
 	{
 		/* Free all of the memory associated with the png_ptr and info_ptr */
 		png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);

--- a/plugins/bmp/xp/ie_impGraphic_BMP.cpp	2014-09-07 07:03:02.000000000 +0200
+++ b/plugins/bmp/xp/ie_impGraphic_BMP.cpp	2014-09-07 12:35:33.306961036 +0200
@@ -191,7 +191,11 @@
 
 	/* Clean Up Memory Used */
 		
-	FREEP(m_pPNGInfo->palette);
+	
+	png_colorp palette;
+	int ignored_placeholder;
+	png_get_PLTE(m_pPNG, m_pPNGInfo, &palette, &ignored_placeholder);
+	FREEP(palette);
 	DELETEP(pBB);
 	png_destroy_write_struct(&m_pPNG, &m_pPNGInfo);
    
--- a/plugins/garble/xp/abiword-garble-png.cpp	2009-09-05 17:34:44.000000000 +0200
+++ b/plugins/garble/xp/abiword-garble-png.cpp	2014-09-08 00:15:04.508335153 +0200
@@ -79,7 +79,7 @@
 		png_set_strip_alpha( png_ptr );
 		png_set_interlace_handling( png_ptr );
 		png_set_bgr( png_ptr );
-		rowbytes = info_ptr->rowbytes;
+		rowbytes = png_get_rowbytes( png_ptr, info_ptr );
 		png_destroy_read_struct( &png_ptr, &info_ptr, NULL );
 	}