Opened 18 years ago
Last modified 18 years ago
#1136 closed defect (fixed)
PNGDataset::Open(...) crash when it fails
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
In PNGDataset::Open(...), if "poDS->hPNG = png_create_read_struct(...)" results in poDS->hPNG being NULL, then there is a "delete poDS;" which calls ~PNGDataset (). In ~PNGDataset(), there is a "png_destroy_read_struct(&hPNG, ...);" which seems to crash when hPNG is NULL (using libpng-1.2.8's png_destroy_read_struct (...)). It might be crashing on the libpng's png_destroy_read_struct's "free_fn = png_ptr->free_fn" line. Maybe ~PNGDataset() could be changed to check if hPNG is NULL before calling png_destroy_read_struct.
Note:
See TracTickets
for help on using tickets.