[Gdal-dev] Bug fix in BMP support

Frank Warmerdam warmerdam at pobox.com
Tue Jun 17 09:24:41 EDT 2003


Ben Discoe wrote:
> This fixes a crash in the BMP reader on Windows:
> 
> RCS file: /cvsroot/osrs/gdal/frmts/bmp/bmpdataset.cpp,v
> retrieving revision 1.20
> diff -w -b -r1.20 bmpdataset.cpp
> 932c932
> <     VSIFCloseL( poOpenInfo->fp );
> ---
> 
>>    VSIFClose( poOpenInfo->fp );
> 
> 
> VSIFClose must be used here, because VSIFOpen was used in GDALOpenInfo
> (core/gdalopen.cpp) to open the file.

Andrey,

I would add that I don't see why bmpdataset.cpp should even be closing the
file managed by the GDALOpenInfo.  Do you have a specific reason this needs
to be done?  If not, please don't.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list