Skip to content

Commit

Permalink
Merge 9fd8b40 into 66259b1
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 6, 2021
2 parents 66259b1 + 9fd8b40 commit 15baaca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tiffcomposite_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,12 @@ namespace Exiv2 {
valueIdx,
dataIdx,
imageIdx);
assert(len <= 4);
#ifndef SUPPRESS_WARNINGS
if (len > 4) {
EXV_ERROR << "Unexpected length in TiffDirectory::writeDirEntry(): len == "
<< len << ".\n";
}
#endif
if (len < 4) {
memset(buf, 0x0, 4);
ioWrapper.write(buf, 4 - len);
Expand Down
Binary file added test/data/issue_1845_poc.jp2
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/bugfixes/github/test_issue_1845.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-

from system_tests import CaseMeta, CopyTmpFiles, path
@CopyTmpFiles("$data_path/issue_1845_poc.jp2")

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

filename = path("$tmp_path/issue_1845_poc.jp2")
commands = ["$exiv2 -q -D +1 ad $filename"]
stderr = [""]
stdout = [""]
retval = [0]

0 comments on commit 15baaca

Please sign in to comment.