* fix: use vector::at() rather than operator[] (#1735) * Regression test for https://github.com/Exiv2/exiv2/issues/1706 * Use vector::at() rather than operator[]. * Print to stderr when exception is caught and EXIV2_DEBUG_MESSAGES is enabled. * Check that it prints "Bad value" for the date. (cherry picked from commit f4d3adbf91e6dc4e34aee5bac7b7fd9e127a5c00) # Conflicts: # src/value.cpp * fix merge conflicts from mergify backport Co-authored-by: Kevin Backhouse <kevinbackhouse@github.com> Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>main
parent
2b84f4bd64
commit
1d64f482ff
Binary file not shown.
@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from system_tests import CaseMeta, path
|
||||
|
||||
|
||||
class InvalidDateXMP(metaclass=CaseMeta):
|
||||
"""
|
||||
Regression test for the bug described in:
|
||||
https://github.com/Exiv2/exiv2/issues/1706
|
||||
"""
|
||||
url = "https://github.com/Exiv2/exiv2/issues/1706"
|
||||
|
||||
filename = path("$data_path/issue_1706_poc.exv")
|
||||
commands = ["$exiv2 -PE $filename"]
|
||||
|
||||
stderr = [
|
||||
"""Error: Directory Photo with 65280 entries considered invalid; not read.
|
||||
"""
|
||||
]
|
||||
retval = [0]
|
||||
|
||||
def compare_stdout(self, i, command, got_stdout, expected_stdout):
|
||||
# Check that it printed "Bad value" for the date.
|
||||
self.assertRegex(got_stdout, "Exif.PentaxDng.Date\\s+Long\\s+1\\s+Bad value")
|
Loading…
Reference in New Issue