Can't parse image info: short read (2/0) at /usr/share/perl5/Image/Info/JPEG.pm line 54.

Bug #150952 reported by Henning Kulander
2
Affects Status Importance Assigned to Milestone
libimage-info-perl (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: libimage-info-perl

Image::Info in perl sometime crashes on JPEG-files while trying to get EXIF info.

I'm using Image::Info in perl to get EXIF-info from some images. Some JPEG images created with ufraw 0.10
from RAW-format seem to trigger a crash in the JPEG-module of Image::Info.

To be more specific, it crashes on line 54 in my_read with a "short read"
when it tries to read 2 bytes, but finds 0.

I have tracked the bug and found that it has something to do with a built
in thumbnail.

In process_app1_exif it's trying to recursively process the thumbnail, and
it sets a variable $jdata to point to the data representing the thumbnail
and process that with a "with_io_string". In my case, $jdata is an empty
string, and when _process_file tries to read 2 bytes from the header of
that file, it crashes.

I fixed this on my machine by adding a check around with_io_string to see
if this string is empty before processing it. It seems to work fine, but
my knowledge of the JPEG-standard is limited at best.. :)

I'm using Image::Info in perl to get EXIF-info from some images. I
recently started using ufraw 0.10 to convert from my cameras RAW-format to
JPEG, and it seems to trigger a crash in the JPEG-module of Image::Info.

To be more specific, it crashes on line 54 in my_read with a "short read"
when it tries to read 2 bytes, but finds 0.

I have tracked the bug and found that it has something to do with a built
in thumbnail.

In process_app1_exif it's trying to recursively process the thumbnail, and
it sets a variable $jdata to point to the data representing the thumbnail
and process that with a "with_io_string". In my case, $jdata is an empty
string, and when _process_file tries to read 2 bytes from the header of
that file, it crashes.

I fixed this on my machine by adding a check around with_io_string to see
if this string is empty before processing it. It seems to work fine, but
my knowledge of the JPEG-standard is limited at best.. :)

Here's the patch I made:

--- JPEG.pm.original 2007-04-07 12:59:46.000000000 +0200
+++ JPEG.pm 2007-10-09 14:22:32.000000000 +0200
@@ -272,9 +272,11 @@
                my $jdata = substr($data, $ipos, $ilen);
                #$info->push_info($i, "JPEGImage" => $jdata);

- with_io_string {
- _process_file($info, $_, $i);
- } $jdata;
+ if (defined $jdata && $jdata ne "") {
+ with_io_string {
+ _process_file($info, $_, $i);
+ } $jdata;
+ }
            }
        }

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 RC or later?

Changed in libimage-info-perl:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in libimage-info-perl:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.