Do not use Image::printStructure() when reading images as this causes security issues.

v0.27.3
Robin Mills 8 years ago committed by Dan Čermák
parent 90305cee1e
commit 8ff26931e3

@ -102,8 +102,6 @@ namespace Exiv2 {
throw Error(kerNotAnImage, "CR2");
}
clearMetadata();
std::ofstream devnull;
printStructure(devnull, kpsRecursive, 0);
ByteOrder bo = Cr2Parser::decode(exifData_,
iptcData_,
xmpData_,

@ -101,15 +101,8 @@ namespace Exiv2 {
throw Error(kerNotACrwImage);
}
clearMetadata();
// read all metadata into memory
// we should put this into clearMetadata(), however it breaks the test suite!
try {
std::ofstream devnull;
printStructure(devnull,kpsRecursive,0);
} catch (Exiv2::Error& /* e */) {
DataBuf file( (long) io().size());
io_->read(file.pData_,file.size_);
}
DataBuf file( (long) io().size());
io_->read(file.pData_,file.size_);
CrwParser::decode(this, io_->mmap(), (uint32_t) io_->size());

@ -114,8 +114,6 @@ namespace Exiv2 {
throw Error(kerNotAnImage, "ORF");
}
clearMetadata();
std::ofstream devnull;
printStructure(devnull, kpsRecursive, 0);
ByteOrder bo = OrfParser::decode(exifData_,
iptcData_,
xmpData_,

@ -125,8 +125,6 @@ namespace Exiv2 {
throw Error(kerNotAnImage, "RW2");
}
clearMetadata();
std::ofstream devnull;
printStructure(devnull, kpsRecursive, 0);
ByteOrder bo = Rw2Parser::decode(exifData_,
iptcData_,
xmpData_,

@ -180,10 +180,6 @@ namespace Exiv2 {
}
clearMetadata();
// recursively print the structure to /dev/null to ensure all metadata is in memory
// must be recursive to handle NEFs which stores the raw image in a subIFDs
std::ofstream devnull;
printStructure(devnull,kpsRecursive);
ByteOrder bo = TiffParser::decode(exifData_,
iptcData_,
xmpData_,

Loading…
Cancel
Save