EXIF reader: fixed file descriptor leak in case of broken tags

This commit is contained in:
Maksim Shabunin 2016-02-25 12:19:11 +03:00
parent 177aef05b6
commit 3a92371b60

View File

@ -170,6 +170,7 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
case APP1: //actual Exif Marker
exifSize = getFieldSize(f);
if (exifSize <= offsetToTiffHeader) {
fclose(f);
throw ExifParsingError();
}
m_data.resize( exifSize - offsetToTiffHeader );