Skip to content

Commit

Permalink
Merge pull request #2579 from Exiv2/bp_pr-2567
Browse files Browse the repository at this point in the history
makernotes: workaround for Olympus header corruption (backport #2567)
  • Loading branch information
kmilos authored Apr 17, 2023
2 parents c60285e + aa10013 commit d6ea2a8
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on_PR_linux_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get install ninja-build
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on_PR_linux_special_buils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get install ninja-build
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install valgrind ninja-build
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get install ninja-build
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install valgrind doxygen graphviz gettext
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_PR_windows_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Install Conan & Common config
run: |
pip.exe install "conan==1.53.0"
pip.exe install "conan==1.54.0"
conan profile new --detect default
conan profile update settings.build_type=${{matrix.build_type}} default
conan profile update settings.compiler="Visual Studio" default
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_push_BasicWinLinMac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Install Conan & Common config
run: |
pip.exe install "conan==1.53.0"
pip.exe install "conan==1.54.0"
conan config install https://github.com/conan-io/conanclientcert.git
conan profile new --detect default
conan profile show default
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- name: install dependencies
run: |
sudo apt-get install ninja-build
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_push_ExtraJobsForMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: install dependencies
run: |
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install ninja-build gettext doxygen graphviz
pip3 install conan==1.53.0
pip3 install conan==1.54.0
- name: Conan common config
run: |
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Install Conan & Common config
run: |
pip.exe install "conan==1.53.0"
pip.exe install "conan==1.54.0"
conan config install https://github.com/conan-io/conanclientcert.git
conan profile new --detect default
conan profile update settings.build_type=Release default
Expand Down
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
Binary file added test/data/poc_2542.exv
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/bugfixes/github/test_issue_2542.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from system_tests import CaseMeta, path

class OMSystemMakerNoteAlias(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/2542
"""
url = "https://github.com/Exiv2/exiv2/issues/2542"

filename = path("$data_path/poc_2542.exv")
commands = ["$exiv2 -q -K Exif.Olympus2.CameraID $filename"]
stdout = ["""Exif.Olympus2.CameraID Undefined 32 OLYMPUS DIGITAL CAMERA
"""]
stderr = [""]
retval = [0]

0 comments on commit d6ea2a8

Please sign in to comment.