Package: xbubble / 0.5.11.2-3.3

libpng15.patch Patch series | download
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
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 xbubble (0.5.11.2-3.2) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Fixes FTBFS: loadpng.c ignoring return value of fread (Closes: #664910).
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: http://bugs.debian.org/664910

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- xbubble-0.5.11.2.orig/src/loadpng.c
+++ xbubble-0.5.11.2/src/loadpng.c
@@ -80,7 +80,11 @@ unsigned char * load_png_file( const cha
     return NULL;
   }
   /* libpng does a longjmp here when it encounters an error */
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+  if ( setjmp(png_jmpbuf(png_ptr)) ) {
+#else
   if ( setjmp( png_ptr->jmpbuf ) ) {
+#endif
     png_destroy_read_struct( &png_ptr, &info_ptr, NULL);
     fclose(fd);
     return NULL;
@@ -102,7 +106,11 @@ unsigned char * load_png_file( const cha
     png_set_gray_to_rgb(png_ptr);
 
   /* detect alpha layer */
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+  if ((png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) ||
+#else
   if (( info_ptr->color_type & PNG_COLOR_MASK_ALPHA )||
+#endif
       ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS )))
     *has_alpha = 1;
   else