60eda5f2ee
All fixes taken from upstream repositories.
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
$OpenBSD: patch-frmts_png_pngdataset_cpp,v 1.1 2011/07/08 20:37:01 naddy Exp $
|
|
|
|
Fix build with png-1.5.
|
|
http://trac.osgeo.org/gdal/changeset/21525/trunk/gdal/frmts/png/pngdataset.cpp
|
|
|
|
--- frmts/png/pngdataset.cpp.orig Thu Jan 13 22:19:04 2011
|
|
+++ frmts/png/pngdataset.cpp Tue Jul 5 17:48:35 2011
|
|
@@ -1315,7 +1315,7 @@ png_vsi_read_data(png_structp png_ptr, png_bytep data,
|
|
* instead of an int, which is what fread() actually returns.
|
|
*/
|
|
check = (png_size_t)VSIFReadL(data, (png_size_t)1, length,
|
|
- (VSILFILE*)png_ptr->io_ptr);
|
|
+ (VSILFILE*)png_get_io_ptr(png_ptr));
|
|
|
|
if (check != length)
|
|
png_error(png_ptr, "Read Error");
|
|
@@ -1330,7 +1330,7 @@ png_vsi_write_data(png_structp png_ptr, png_bytep data
|
|
{
|
|
png_uint_32 check;
|
|
|
|
- check = VSIFWriteL(data, 1, length, (VSILFILE*)(png_ptr->io_ptr));
|
|
+ check = VSIFWriteL(data, 1, length, (VSILFILE*)png_get_io_ptr(png_ptr));
|
|
|
|
if (check != length)
|
|
png_error(png_ptr, "Write Error");
|
|
@@ -1341,7 +1341,7 @@ png_vsi_write_data(png_structp png_ptr, png_bytep data
|
|
/************************************************************************/
|
|
static void png_vsi_flush(png_structp png_ptr)
|
|
{
|
|
- VSIFFlushL( (VSILFILE*)(png_ptr->io_ptr) );
|
|
+ VSIFFlushL( (VSILFILE*)png_get_io_ptr(png_ptr) );
|
|
}
|
|
|
|
/************************************************************************/
|
|
@@ -1357,7 +1357,7 @@ static void png_gdal_error( png_structp png_ptr, const
|
|
// libpng is generally not built as C++ and so won't honour unwind
|
|
// semantics. Ugg.
|
|
|
|
- jmp_buf* psSetJmpContext = (jmp_buf*) png_ptr->error_ptr;
|
|
+ jmp_buf* psSetJmpContext = (jmp_buf*) png_get_error_ptr(png_ptr);
|
|
if (psSetJmpContext)
|
|
{
|
|
longjmp( *psSetJmpContext, 1 );
|