Project

General

Profile

Bug #573

Crash in ExifData::getThumbnail () with corrupt jpeg

Added by Phillip - about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
exif
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Try to process the attached jpeg file and you will see it crashing in ExifData::getThumbnail() in exif.cpp because it calls pos->toLong() but *pos is empty so it has no value.

Additional information:

Here is a patch that fixes the crash:

--- exif.cpp 2008-09-23 11:41:35.044651776 -0600
+++ exif-new.cpp 2008-09-22 13:11:32.000000000 -0600
@ -1019,7 +1019,7 @ {
Thumbnail::AutoPtr thumbnail;
const_iterator pos = findKey(ExifKey("Exif.Thumbnail.Compression"));
- if (pos != end()) {
+ if (pos != end() && pos->size() > 0) {
long compression = pos->toLong();
if (compression == 6) {
thumbnail = Thumbnail::AutoPtr(new JpegThumbnail);


Files

Carved__14781904_.jpeg (873 KB) Carved__14781904_.jpeg Redmine Admin, 23 Sep 2008 10:46

Related issues

Is duplicate of Exiv2 - Bug #568: [svn r.1571] exiv2 -ps crash for some jpeg files.Closed

Actions

History

#1

Updated by Andreas Huggel about 13 years ago

Thanks for the report and patch.

In the trunk this was fixed with r1572 for #568. (It looks different there, the thumbnail code is now in its own class).

#2

Updated by Andreas Huggel about 13 years ago

The attached image has a badly corrupted thumbnail IFD (IFD1).

#3

Updated by Andreas Huggel almost 13 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF