diff --git a/exiv2.md b/exiv2.md index 86dd7fd2a7..7a5ff8c610 100644 --- a/exiv2.md +++ b/exiv2.md @@ -116,6 +116,10 @@ and see if `enable_bmff=1`. - Naked codestream JXL files do not contain Exif, IPTC or XMP metadata. +- Support of video files is limited. Currently **exiv2** only has some + rudimentary support to read metadata from quicktime based video files (e.g. + .MOV/.MP4). + [TOC](#TOC) diff --git a/src/quicktimevideo.cpp b/src/quicktimevideo.cpp index a96b3fc4c2..5362ea1f4d 100644 --- a/src/quicktimevideo.cpp +++ b/src/quicktimevideo.cpp @@ -668,7 +668,7 @@ void QuickTimeVideo::previewTagDecoder(size_t size) { if (equalsQTimeTag(buf, "PICT")) xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture"; else - xmpData_["Xmp.video.PreviewAtomType"] = Exiv2::toString(buf.data()); + xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4}; io_->seek(cur_pos + size, BasicIo::beg); } // QuickTimeVideo::previewTagDecoder @@ -685,7 +685,7 @@ void QuickTimeVideo::keysTagDecoder(size_t size) { if (equalsQTimeTag(buf, "PICT")) xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture"; else - xmpData_["Xmp.video.PreviewAtomType"] = Exiv2::toString(buf.data()); + xmpData_["Xmp.video.PreviewAtomType"] = std::string{buf.c_str(), 4}; io_->seek(cur_pos + size, BasicIo::beg); } // QuickTimeVideo::keysTagDecoder diff --git a/test/data/issue_2340_poc.mp4 b/test/data/issue_2340_poc.mp4 new file mode 100644 index 0000000000..ab3291b93f Binary files /dev/null and b/test/data/issue_2340_poc.mp4 differ diff --git a/tests/bugfixes/github/test_issue_2340.py b/tests/bugfixes/github/test_issue_2340.py new file mode 100644 index 0000000000..2d98ed7889 --- /dev/null +++ b/tests/bugfixes/github/test_issue_2340.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + +from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors + +class issue_2320_printDegrees_integer_overflow(metaclass=CaseMeta): + url = "https://github.com/Exiv2/exiv2/issues/2340" + filename = "$data_path/issue_2340_poc.mp4" + commands = ["$exiv2 -q -pa $filename"] + retval = [1] + stderr = ["""$exiv2_exception_message $filename: +$kerCorruptedMetadata +"""] + compare_stdout = check_no_ASAN_UBSAN_errors diff --git a/tests/regression_tests/test_regression_allfiles.py b/tests/regression_tests/test_regression_allfiles.py index 6a9d5a2e5b..03c1929913 100644 --- a/tests/regression_tests/test_regression_allfiles.py +++ b/tests/regression_tests/test_regression_allfiles.py @@ -58,6 +58,7 @@ def get_valid_files(data_dir): "issue_2190_poc.jp2", # non-zero return code files, most of them are security POC so we don't # really need to worry about them here + "issue_2340_poc.mp4", "2018-01-09-exiv2-crash-001.tiff", "cve_2017_1000126_stack-oob-read.webp", "exiv2-bug1247.jpg",