Skip to content

Commit

Permalink
Merge pull request #1848 from kevinbackhouse/FixIssue1847
Browse files Browse the repository at this point in the history
Replace assertion with an error message
  • Loading branch information
kevinbackhouse authored Aug 5, 2021
2 parents 4f15518 + e33a2be commit 7070063
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tiffcomposite_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,11 @@ namespace Exiv2 {
for (Components::const_iterator i = components_.begin(); i != components_.end(); ++i) {
if ((*i)->tag() == 0x014a) {
// Hack: delay writing of sub-IFD image data to get the order correct
assert(pSubIfd == 0);
#ifndef SUPPRESS_WARNINGS
if (pSubIfd != 0) {
EXV_ERROR << "Multiple sub-IFD image data tags found\n";
}
#endif
pSubIfd = *i;
continue;
}
Expand Down
Binary file added test/data/issue_1847_poc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions tests/bugfixes/github/test_issue_1847.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-

from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors

class TiffMnEntryDoCountInvalidTiffType(metaclass=CaseMeta):
"""
Test for the bug described in:
https://github.com/Exiv2/exiv2/issues/1847
"""
url = "https://github.com/Exiv2/exiv2/issues/1847"

filename = path("$data_path/issue_1847_poc.jpg")
commands = ["$exiv2 -pS $filename"]
stderr = [""]
retval = [0]

compare_stdout = check_no_ASAN_UBSAN_errors

0 comments on commit 7070063

Please sign in to comment.