Commit 91d8405e authored by Ilya Lavrenov's avatar Ilya Lavrenov

stop search of markers in Exif reader to prevent infinite loop

parent 02aabcca
...@@ -140,8 +140,8 @@ std::map<int, ExifEntry_t > ExifReader::getExif() ...@@ -140,8 +140,8 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
return m_exif; //Until this moment the map is empty return m_exif; //Until this moment the map is empty
} }
bool exifFound = false; bool exifFound = false, stopSearch = false;
while( ( !feof( f ) ) && !exifFound ) while( ( !feof( f ) ) && !exifFound && !stopSearch )
{ {
count = fread( appMarker, sizeof(unsigned char), markerSize, f ); count = fread( appMarker, sizeof(unsigned char), markerSize, f );
if( count < markerSize ) if( count < markerSize )
...@@ -180,6 +180,7 @@ std::map<int, ExifEntry_t > ExifReader::getExif() ...@@ -180,6 +180,7 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
break; break;
default: //No other markers are expected according to standard. May be a signal of error default: //No other markers are expected according to standard. May be a signal of error
stopSearch = true;
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment