Skip to content

Commit

Permalink
makernotes: workaround for Olympus header corruption (backport #2567)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos committed Apr 4, 2023
1 parent a2b97de commit 04d3a7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/makernote_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,13 @@ namespace Exiv2 {
uint32_t size,
ByteOrder /*byteOrder*/)
{
// FIXME: workaround for overwritten OM System header in Olympus files (https://github.com/Exiv2/exiv2/issues/2542)
if (size >= 14 && std::string(reinterpret_cast<const char*>(pData), 14)
== std::string("OM SYSTEM\0\0\0II", 14)) {
// Require at least the header and an IFD with 1 entry
if (size < OMSystemMnHeader::sizeOfSignature() + 18) return 0;
return newOMSystemMn2(tag, group, olympus2Id);
}
if (size < 10 || std::string(reinterpret_cast<const char*>(pData), 10)
!= std::string("OLYMPUS\0II", 10)) {
// Require at least the header and an IFD with 1 entry
Expand Down

0 comments on commit 04d3a7c

Please sign in to comment.