Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makernotes: workaround for Olympus header corruption (backport #2567) #2579

Merged
merged 3 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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]