Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ DataBuf LoaderNative::getData() const {
#endif
return {};
}
Internal::enforce(sizeData >= 28, ErrorCode::kerCorruptedMetadata);
Comment thread
kevinbackhouse marked this conversation as resolved.
return {record + sizeHdr + 28, sizeData - 28};
}
throw Error(ErrorCode::kerErrorMessage, "Invalid native preview filter: ", nativePreview_.filter_);
Expand Down
13 changes: 13 additions & 0 deletions test/data/issue_3511_poc.eps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 100 100
%%EndComments
%%BeginProlog
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
%%EndPageSetup
%BeginPhotoshop: 16
3842494D040C00000000000441424344
%EndPhotoshop
%%PageTrailer
%%EOF
17 changes: 17 additions & 0 deletions tests/bugfixes/github/test_issue_3511.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-

import system_tests


class test_issue_3511_sigma_LoaderNative_getData(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/3511"

filename = "$data_path/issue_3511_poc.eps"
commands = ["$exiv2 -pp $filename"]
retval = [1]
stderr = [
"""$exiv2_exception_message $filename:
$kerCorruptedMetadata
"""
]
stdout = [""]
1 change: 1 addition & 0 deletions tests/regression_tests/test_regression_allfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def get_valid_files(data_dir):
"poc_1522.jp2",
"xmpsdk.xmp",
"crash-23eba73bb01cb01caa96a389eb12955c34b98a37.jpg",
"issue_3511_poc.eps",
# large file that creates 11Mb of output so let's exclude it
"ReaganLargeTiff.tiff",
# files that don't create any output
Expand Down
Loading