summaryrefslogtreecommitdiff
blob: e0411a3ea69601c72d50dd47bfbfe283b5fc1e94 (plain)
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
https://bugs.gentoo.org/386009

--- frmts/png/pngdataset.cpp
+++ frmts/png/pngdataset.cpp
@@ -1288,7 +1288,7 @@
     * instead of an int, which is what fread() actually returns.
     */
    check = (png_size_t)VSIFReadL(data, (png_size_t)1, length,
-                                 (png_FILE_p)png_ptr->io_ptr);
+                                 (png_FILE_p)png_get_io_ptr(png_ptr));
 
    if (check != length)
       png_error(png_ptr, "Read Error");
@@ -1303,7 +1303,7 @@
 {
    png_uint_32 check;
 
-   check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
+   check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_get_io_ptr(png_ptr)));
 
    if (check != length)
       png_error(png_ptr, "Write Error");
@@ -1314,7 +1314,7 @@
 /************************************************************************/
 static void png_vsi_flush(png_structp png_ptr)
 {
-    VSIFFlushL( (png_FILE_p)(png_ptr->io_ptr) );
+    VSIFFlushL( (png_FILE_p)(png_get_io_ptr(png_ptr)) );
 }
 
 /************************************************************************/
@@ -1330,7 +1330,7 @@
     // 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 );