Changeset 13366
- Timestamp:
- 12/18/07 16:30:32 (5 months ago)
- Files:
-
- trunk/gdal/frmts/png/pngdataset.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/png/pngdataset.cpp
r13302 r13366 466 466 hPNG = png_create_read_struct( PNG_LIBPNG_VER_STRING, this, NULL, NULL ); 467 467 468 png_set_error_fn( hPNG, this, png_gdal_error, png_gdal_warning );468 png_set_error_fn( hPNG, &sSetJmpContext, png_gdal_error, png_gdal_warning ); 469 469 if( setjmp( sSetJmpContext ) != 0 ) 470 470 return; … … 778 778 /* Setup error handling. */ 779 779 /* -------------------------------------------------------------------- */ 780 png_set_error_fn( poDS->hPNG, poDS, png_gdal_error, png_gdal_warning );780 png_set_error_fn( poDS->hPNG, &poDS->sSetJmpContext, png_gdal_error, png_gdal_warning ); 781 781 782 782 if( setjmp( poDS->sSetJmpContext ) != 0 ) … … 1055 1055 png_infop psPNGInfo; 1056 1056 1057 jmp_buf sSetJmpContext; 1057 1058 hPNG = png_create_write_struct( PNG_LIBPNG_VER_STRING, 1058 NULL, NULL, NULL);1059 &sSetJmpContext, png_gdal_error, png_gdal_warning ); 1059 1060 psPNGInfo = png_create_info_struct( hPNG ); 1060 1061 1062 if( setjmp( sSetJmpContext ) != 0 ) 1063 { 1064 VSIFCloseL( fpImage ); 1065 png_destroy_write_struct( &hPNG, &psPNGInfo ); 1066 return NULL; 1067 } 1068 1061 1069 png_set_write_fn( hPNG, fpImage, png_vsi_write_data, png_vsi_flush ); 1062 1070 … … 1323 1331 // semantics. Ugg. 1324 1332 1325 PNGDataset *poDS = (PNGDataset *) png_ptr->error_ptr; 1326 1327 longjmp( poDS->sSetJmpContext, 1 ); 1333 jmp_buf* psSetJmpContext = (jmp_buf*) png_ptr->error_ptr; 1334 if (psSetJmpContext) 1335 { 1336 longjmp( *psSetJmpContext, 1 ); 1337 } 1328 1338 } 1329 1339
