From 3a92371b60f2891ad1cf2b8cfe42b626f5062d40 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 25 Feb 2016 12:19:11 +0300 Subject: [PATCH] EXIF reader: fixed file descriptor leak in case of broken tags --- modules/imgcodecs/src/jpeg_exif.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/imgcodecs/src/jpeg_exif.cpp b/modules/imgcodecs/src/jpeg_exif.cpp index 61b27bbf90..adb87e5b77 100644 --- a/modules/imgcodecs/src/jpeg_exif.cpp +++ b/modules/imgcodecs/src/jpeg_exif.cpp @@ -170,6 +170,7 @@ std::map ExifReader::getExif() case APP1: //actual Exif Marker exifSize = getFieldSize(f); if (exifSize <= offsetToTiffHeader) { + fclose(f); throw ExifParsingError(); } m_data.resize( exifSize - offsetToTiffHeader );