Bug#809905: scorched3d: diff for NMU version 43.3.d+dfsg-1.2

Tobias Frost tobi at debian.org
Sun Jan 24 13:51:14 UTC 2016


Control: tags 809905 + patch
Control: tags 809905 + pending

Dear maintainer,

I've prepared an NMU for scorched3d (versioned as 43.3.d+dfsg-1.2) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should delay it longer.

Regards.
diff -Nru scorched3d-43.3.d+dfsg/debian/changelog scorched3d-43.3.d+dfsg/debian/changelog
--- scorched3d-43.3.d+dfsg/debian/changelog	2014-05-27 04:48:01.000000000 +0200
+++ scorched3d-43.3.d+dfsg/debian/changelog	2016-01-24 14:33:34.000000000 +0100
@@ -1,3 +1,10 @@
+scorched3d (43.3.d+dfsg-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix "FTBFS with libpng16" -- adapt to new libpng API (Closes: #809905)
+
+ -- Tobias Frost <tobi at debian.org>  Sun, 24 Jan 2016 14:33:34 +0100
+
 scorched3d (43.3.d+dfsg-1.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru scorched3d-43.3.d+dfsg/debian/patches/libpng16.patch scorched3d-43.3.d+dfsg/debian/patches/libpng16.patch
--- scorched3d-43.3.d+dfsg/debian/patches/libpng16.patch	1970-01-01 01:00:00.000000000 +0100
+++ scorched3d-43.3.d+dfsg/debian/patches/libpng16.patch	2016-01-24 14:26:47.000000000 +0100
@@ -0,0 +1,91 @@
+--- a/src/common/image/ImagePngFactory.cpp
++++ b/src/common/image/ImagePngFactory.cpp
+@@ -62,7 +62,7 @@
+ 
+ static void user_png_error(png_structp png_ptr, png_const_charp msg) 
+ {
+-	longjmp(png_ptr->jmpbuf,1);
++	longjmp(png_jmpbuf(png_ptr),1);
+ }
+ 
+ static void user_png_warning(png_structp png_ptr, png_const_charp msg) 
+--- a/src/client/client/LoadPNG.cpp
++++ b/src/client/client/LoadPNG.cpp
+@@ -28,6 +28,7 @@
+ 	int row, i;
+ 	volatile int ckey = -1;
+ 	png_color_16 *transv;
++        png_byte channels;
+ 
+ 	if ( !src ) {
+ 		/* The error message has been set in SDL_RWFromFile */
+@@ -58,7 +59,7 @@
+ 	 * the normal method of doing things with libpng).  REQUIRED unless you
+ 	 * set up your own error handlers in png_create_read_struct() earlier.
+ 	 */
+-	if ( setjmp(png_ptr->jmpbuf) ) {
++	if ( setjmp(png_jmpbuf(png_ptr)) ) {
+ 		error = "Error reading the PNG file.";
+ 		goto done;
+ 	}
+@@ -122,14 +123,17 @@
+ 
+ 	/* Allocate the SDL surface to hold the image */
+ 	Rmask = Gmask = Bmask = Amask = 0 ; 
++
++        channels = png_get_channels(png_ptr, info_ptr);
++
+ 	if ( color_type != PNG_COLOR_TYPE_PALETTE ) {
+ 		if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
+ 			Rmask = 0x000000FF;
+ 			Gmask = 0x0000FF00;
+ 			Bmask = 0x00FF0000;
+-			Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
++			Amask = (channels == 4) ? 0xFF000000 : 0;
+ 		} else {
+-		        int s = (info_ptr->channels == 4) ? 0 : 8;
++		        int s = (channels == 4) ? 0 : 8;
+ 			Rmask = 0xFF000000 >> s;
+ 			Gmask = 0x00FF0000 >> s;
+ 			Bmask = 0x0000FF00 >> s;
+@@ -137,7 +141,7 @@
+ 		}
+ 	}
+ 	surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
+-			bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
++			bit_depth*channels, Rmask,Gmask,Bmask,Amask);
+ 	if ( surface == NULL ) {
+ 		error = "Out of memory";
+ 		goto done;
+@@ -176,8 +180,12 @@
+ 	*/
+ 
+ 	/* Load the palette, if any */
++
+ 	palette = surface->format->palette;
+ 	if ( palette ) {
++            int num_palette;
++            png_colorp png_palette;
++            png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette);
+ 	    if(color_type == PNG_COLOR_TYPE_GRAY) {
+ 		palette->ncolors = 256;
+ 		for(i = 0; i < 256; i++) {
+@@ -185,12 +193,12 @@
+ 		    palette->colors[i].g = i;
+ 		    palette->colors[i].b = i;
+ 		}
+-	    } else if (info_ptr->num_palette > 0 ) {
+-		palette->ncolors = info_ptr->num_palette; 
+-		for( i=0; i<info_ptr->num_palette; ++i ) {
+-		    palette->colors[i].b = info_ptr->palette[i].blue;
+-		    palette->colors[i].g = info_ptr->palette[i].green;
+-		    palette->colors[i].r = info_ptr->palette[i].red;
++	    } else if (num_palette > 0 ) {
++		palette->ncolors = num_palette;
++		for( i=0; i<num_palette; ++i ) {
++		    palette->colors[i].b = png_palette[i].blue;
++		    palette->colors[i].g = png_palette[i].green;
++		    palette->colors[i].r = png_palette[i].red;
+ 		}
+ 	    }
+ 	}
diff -Nru scorched3d-43.3.d+dfsg/debian/patches/series scorched3d-43.3.d+dfsg/debian/patches/series
--- scorched3d-43.3.d+dfsg/debian/patches/series	2014-05-01 11:06:10.000000000 +0200
+++ scorched3d-43.3.d+dfsg/debian/patches/series	2016-01-24 14:00:27.000000000 +0100
@@ -6,3 +6,4 @@
 0006-fix-freetype-includes.patch
 0007-spelling.patch
 0008-wx3.0-compat.patch
+libpng16.patch



More information about the Pkg-games-devel mailing list