[rbdoom3bfg] 01/01: Fix FTBFS with libpng1.6 (Closes: #809866)
Tobias Frost
tobi at moszumanska.debian.org
Mon Jan 25 20:47:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
tobi pushed a commit to branch master
in repository rbdoom3bfg.
commit f375a8b52897738ad003c42ddba8773c35f71ffb
Author: Tobias Frost <tobi at coldtobi.de>
Date: Mon Jan 25 21:47:44 2016 +0100
Fix FTBFS with libpng1.6 (Closes: #809866)
---
debian/changelog | 1 +
debian/patches/libpng16.patch | 69 +++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 3 +-
3 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index c5a192a..56fb9ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
rbdoom3bfg (1.0.3+repack1+git20151124-1) UNRELEASED; urgency=medium
* New upstream git snapshot.
+ * Fix FTBFS with libpng1.6 (Closes: #809866)
-- Tobias Frost <tobi at debian.org> Tue, 24 Nov 2015 19:41:31 +0100
diff --git a/debian/patches/libpng16.patch b/debian/patches/libpng16.patch
new file mode 100644
index 0000000..87bf987
--- /dev/null
+++ b/debian/patches/libpng16.patch
@@ -0,0 +1,69 @@
+--- a/neo/renderer/Image_files.cpp
++++ b/neo/renderer/Image_files.cpp
+@@ -621,6 +621,7 @@
+
+ extern "C"
+ {
++#include <string.h>
+ #include <png.h>
+
+
+@@ -636,9 +637,12 @@
+
+ static void png_ReadData( png_structp pngPtr, png_bytep data, png_size_t length )
+ {
+- memcpy( data, ( byte* )pngPtr->io_ptr, length );
+-
+- pngPtr->io_ptr = ( ( byte* ) pngPtr->io_ptr ) + length;
++
++ // There is a get_io_ptr but not a set_io_ptr.. Therefore we need some tmp storage here.
++ byte **ioptr = (byte **)png_get_io_ptr(pngPtr);
++
++ memcpy( data, *ioptr, length );
++ *ioptr += length;
+ }
+
+ }
+@@ -651,6 +655,7 @@
+ static void LoadPNG( const char* filename, unsigned char** pic, int* width, int* height, ID_TIME_T* timestamp )
+ {
+ byte* fbuffer;
++ byte* readptr;
+
+ if( !pic )
+ {
+@@ -683,7 +688,8 @@
+ common->Error( "LoadPNG( %s ): png_create_info_struct failed", filename );
+ }
+
+- png_set_read_fn( pngPtr, fbuffer, png_ReadData );
++ readptr = fbuffer;
++ png_set_read_fn( pngPtr, &readptr, png_ReadData );
+
+ png_set_sig_bytes( pngPtr, 0 );
+
+@@ -770,10 +776,11 @@
+ static int png_compressedSize = 0;
+ static void png_WriteData( png_structp pngPtr, png_bytep data, png_size_t length )
+ {
+- memcpy( ( byte* )pngPtr->io_ptr, data, length );
+-
+- pngPtr->io_ptr = ( ( byte* ) pngPtr->io_ptr ) + length;
++ byte **ioptr = (byte**)png_get_io_ptr(pngPtr);
++
++ memcpy( *ioptr, data, length );
+
++ *ioptr += length;
+ png_compressedSize += length;
+ }
+
+@@ -802,7 +809,8 @@
+
+ png_compressedSize = 0;
+ byte* buffer = ( byte* ) Mem_Alloc( width * height * bytesPerPixel, TAG_TEMP );
+- png_set_write_fn( pngPtr, buffer, png_WriteData, png_FlushData );
++ byte* ioptr = buffer;
++ png_set_write_fn( pngPtr, &ioptr, png_WriteData, png_FlushData );
+
+ if( bytesPerPixel == 4 )
+ {
diff --git a/debian/patches/series b/debian/patches/series
index 3318d9a..2473607 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
10-lowercase-executeable.patch
20-reproducible.patch
-65-init-sdl2.patch
+#65-init-sdl2.patch
70-ffmpeg_2.9.patch
+libpng16.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/rbdoom3bfg.git
More information about the Pkg-games-commits
mailing list