Replace assertion with an error message.

main
Kevin Backhouse 4 years ago
parent cca3e0766d
commit 9e160a453b
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

@ -1540,7 +1540,11 @@ namespace Exiv2 {
for (auto&& component : components_) {
if (component->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 = component;
continue;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@ -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
Loading…
Cancel
Save