diff --git a/test/data/issue_1881_poc.jpg b/test/data/issue_1881_poc.jpg new file mode 100644 index 00000000..c666fe88 Binary files /dev/null and b/test/data/issue_1881_poc.jpg differ diff --git a/tests/bugfixes/github/test_issue_1881.py b/tests/bugfixes/github/test_issue_1881.py new file mode 100644 index 00000000..74bd5d0d --- /dev/null +++ b/tests/bugfixes/github/test_issue_1881.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from system_tests import CaseMeta, CopyTmpFiles, path +@CopyTmpFiles("$data_path/issue_1881_poc.jpg") + +class SonyPreviewImageLargeAllocation(metaclass=CaseMeta): + """ + Regression test for the bug described in: + https://github.com/Exiv2/exiv2/issues/1881 + """ + url = "https://github.com/Exiv2/exiv2/issues/1881" + + filename = path("$tmp_path/issue_1881_poc.jpg") + commands = ["$exiv2 -q -d I rm $filename"] + stdout = [""] + stderr = [ +"""Exiv2 exception in erase action for file $filename: +$kerCorruptedMetadata +"""] + retval = [1]