assert(tiffType() == ttUndefined) error in tiffcomposite.cpp
Added by Auke Nauta almost 10 years ago
Hi,
With the attached image I am getting an assertion error in tiffcomposite.cpp, function doCount(), line 1032: (svn trunk 2656)
uint32_t TiffMnEntry::doCount() const
{
if (!mn_) {
return TiffEntryBase::doCount();
}
// Count of IFD makernote in tag Exif.Photo.MakerNote is the size of the
// Makernote in bytes
assert(tiffType() == ttUndefined);
return mn_->size();
}
This happens at the point of calling ExifParser::encode():
Image::AutoPtr srcimg=ImageFactory::open("SDC11037-0006.jpg");
srcimg->readMetadata();
ExifData &ed=srcimg->exifData();
Blob blob;
ExifParser::encode(blob, littleEndian, ed);
Please could you have a look?
(My application is being halted due to this error. Could that be prevented?)
Thanks and greetings,
Auke Nauta
SDC11037-0006.jpg (328 KB) SDC11037-0006.jpg |
Replies (2)
RE: assert(tiffType() == ttUndefined) error in tiffcomposite.cpp - Added by Andreas Huggel almost 10 years ago
Yes, I can reproduce this bug and created issue #810 for it. I can't see a simple workaround.
Thanks for reporting it!
Andreas
RE: assert(tiffType() == ttUndefined) error in tiffcomposite.cpp - Added by Andreas Huggel almost 10 years ago
The issue was fixed with r2664. The sample image contains an invalid (or unrecognized) makernote which is only 2 bytes long. Exiv2 parsed it anyway, which worked, but failed to encode it. Added sanity-checks for the minimum size of the makernote so that Exiv2 doesn't attempt to decode it anymore when it's too short.
Andreas