Skip to content

Commit

Permalink
Merge pull request #2382 from Exiv2/027_fix_bmff_exif_offset
Browse files Browse the repository at this point in the history
Exif start can be at any byte in payload, not word aligned
  • Loading branch information
kmilos authored Oct 19, 2022
2 parents 4f1d091 + cd1f315 commit cbf549b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bmffimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ namespace Exiv2
// hunt for "II" or "MM"
long eof = 0xffffffff; // impossible value for punt
long punt = eof;
for ( long i = 0 ; i < exif.size_ -8 && punt==eof ; i+=2) {
for (long i = 0; i < exif.size_ - 9 && punt == eof; ++i) {
if ( exif.pData_[i] == exif.pData_[i+1] )
if ( exif.pData_[i] == 'I' || exif.pData_[i] == 'M' )
punt = i;
Expand Down

0 comments on commit cbf549b

Please sign in to comment.