From 50cdbcc50053876ace5719d1b9d7fa0c9930dbcd Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Fri, 27 Aug 2021 16:56:20 +0100 Subject: [PATCH] Regression test for https://github.com/Exiv2/exiv2/issues/1881 (cherry picked from commit 218ad98f227f88011243decdaf8d66ac06c31c16) --- test/data/issue_1881_poc.jpg | Bin 0 -> 3195 bytes tests/bugfixes/github/test_issue_1881.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/data/issue_1881_poc.jpg create mode 100644 tests/bugfixes/github/test_issue_1881.py diff --git a/test/data/issue_1881_poc.jpg b/test/data/issue_1881_poc.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c666fe8854614c2afd47951754ee7ade74c39265 GIT binary patch literal 3195 zcmeHJ%}*0i5TAV@LdymdZ^pz%;ZTruH&7`(s8BR%LZxZ(Kq7}0Udx)6ZQ89O8a!4L zJ)4lgf562{qh36iUN~4Z(Q-7NNxYGmlyP2nOG||i6Cxfu$=jK?Z{~gc=FPmpGKQxn zzuBa*d7d<*zZr$~c}6@LV?L*- z@>j&|D@(|r(>>IkE~Aooa_ZziPrU{0)t-t!~Y2 ztUrHSBKhSOi$qgt!h03b@IkH-^gw8uR5}0ze@}dR%mLT!6`T)3E@_O(k~{BkVV0eN z4~(5>4B7zBG4J>#n};GG(aFIv3l_{jZMYAzB+s%++u4D<{_xIZAWRFvySz>a3KRjv z=+2&xMx9RQh33(A(x^dZZ}0RGfm27shGLKS3u@$r4si(ut-x+K6Sq{d@Dtr~JCYpd?SZTwXd?7d3Tb@ftny152r7JuCDcnNUtT JE&M;}?l-BJS)2d> literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_1881.py b/tests/bugfixes/github/test_issue_1881.py new file mode 100644 index 0000000000..74bd5d0dbb --- /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]