Source: gdal
Version: 1.7.3-5
Severity: important
Tags: patch
User: [email protected]
Usertags: libpng15-transition
Hi,
I uploaded libpng 1.5.2 to experimental.
libpng maintainers plan to transition from libpng 1.2 to 1.5.
I am checking build it the package depend to libpng.
I noticed your package FTBFS by libpng 1.5.
I created the patch that revise this problem.
Could you check and apply this patch?
Best regards,
Nobuhiro
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.39-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
diff --git a/frmts/png/pngdataset.cpp b/frmts/png/pngdataset.cpp
index a126e56..e7dea29 100644
--- a/frmts/png/pngdataset.cpp
+++ b/frmts/png/pngdataset.cpp
@@ -1296,8 +1296,11 @@ png_vsi_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
* instead of an int, which is what fread() actually returns.
*/
check = (png_size_t)VSIFReadL(data, (png_size_t)1, length,
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ (png_FILE_p)png_get_io_ptr(png_ptr));
+#else
(png_FILE_p)png_ptr->io_ptr);
-
+#endif
if (check != length)
png_error(png_ptr, "Read Error");
}
@@ -1311,7 +1314,11 @@ png_vsi_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ check = VSIFWriteL(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
+#else
check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
+#endif
if (check != length)
png_error(png_ptr, "Write Error");
@@ -1322,7 +1329,11 @@ png_vsi_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
/************************************************************************/
static void png_vsi_flush(png_structp png_ptr)
{
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ VSIFFlushL( (png_FILE_p)png_get_io_ptr(png_ptr) );
+#else
VSIFFlushL( (png_FILE_p)(png_ptr->io_ptr) );
+#endif
}
/************************************************************************/
@@ -1337,8 +1348,11 @@ static void png_gdal_error( png_structp png_ptr, const char *error_message )
// We have to use longjmp instead of a C++ exception because
// libpng is generally not built as C++ and so won't honour unwind
// semantics. Ugg.
-
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
+ jmp_buf* psSetJmpContext = (jmp_buf*) png_get_error_ptr(png_ptr);
+#else
jmp_buf* psSetJmpContext = (jmp_buf*) png_ptr->error_ptr;
+#endif
if (psSetJmpContext)
{
longjmp( *psSetJmpContext, 1 );