Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37492
Throw an error if the size of the preview is greater than 1MB.
This commit is contained in:
parent
218ad98f22
commit
60144df557
@ -1598,6 +1598,9 @@ namespace Exiv2 {
|
||||
if ( !isize ) {
|
||||
v->read(pData, size, byteOrder());
|
||||
} else {
|
||||
// Prevent large memory allocations: https://github.com/Exiv2/exiv2/issues/1881
|
||||
enforce(isize <= 1024 * 1024, kerCorruptedMetadata);
|
||||
|
||||
// #1143 Write a "hollow" buffer for the preview image
|
||||
// Sadly: we don't know the exact location of the image in the source (it's near offset)
|
||||
// And neither TiffReader nor TiffEntryBase have access to the BasicIo object being processed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user