fix a memleak in exif parsing

This commit is contained in:
John Cupitt 2016-11-10 11:09:49 +00:00
parent 5cc9229882
commit ab6bb83266
2 changed files with 6 additions and 6 deletions

3
TODO
View File

@ -1,6 +1,3 @@
- test under valgrind
- not sure about utf8 error messages on win
- strange:

View File

@ -366,15 +366,16 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed )
/* The main image xres/yres are in ifd0. ifd1 has xres/yres of the
* image thumbnail, if any.
*
* Don't warn about missing res fields, it's very common, especially for
* things like webp.
*/
if( vips_exif_entry_get_double( ed, 0, EXIF_TAG_X_RESOLUTION, &xres ) ||
vips_exif_entry_get_double( ed,
0, EXIF_TAG_Y_RESOLUTION, &yres ) ||
vips_exif_entry_get_int( ed,
0, EXIF_TAG_RESOLUTION_UNIT, &unit ) ) {
vips_warn( "exif", "%s", _( "error reading resolution" ) );
0, EXIF_TAG_RESOLUTION_UNIT, &unit ) )
return( -1 );
}
#ifdef DEBUG
printf( "vips_image_resolution_from_exif: seen exif tags "
@ -1106,6 +1107,8 @@ vips__exif_update( VipsImage *image )
vips_image_set_blob( image, VIPS_META_EXIF_NAME,
(VipsCallbackFn) vips_free, data, length );
exif_data_free( ed );
return( 0 );
}