Menu

#1064 Bad InteropIFD directory causes crash

open
jpeg (6)
5
2008-08-17
2008-08-17
Anonymous
No

Some of my images crash the GetExif function with the following error:

---------------------------
Error in startup script
---------------------------
expected integer but got ""
while executing
"format %u $value"
("4" arm line 3)
invoked from within
"switch -exact -- $type {
1 { _scan $end $value c value }
2 { set value [string trimright $value \x00] }
3 {
_scan ..."
(procedure "_format" line 11)
invoked from within
"_format $end [string range $value [expr {$len * $i}] [expr {($len * $i) + $len - 1}]] $type 1"
(procedure "_format" line 7)
invoked from within
"_format $byteOrder $value $format $components"
(procedure "_exif" line 35)
invoked from within
"_exif $fh $byteOrder $offset"
(procedure "_exif" line 19)
invoked from within
"_exif $fh $byteOrder $offset"
(procedure "_exif" line 19)
invoked from within
"_exif $fh $byteOrder $start"
(procedure "::jpeg::getExif" line 28)
invoked from within
"::jpeg::getExif "CIMG0049.JPG" "
invoked from within
"set t [ ::jpeg::getExif "CIMG0049.JPG" ]"
...
---------------------------
OK
---------------------------

The camera is
Make : CASIO COMPUTER CO.,LTD
Model : QV-R41
Software : 1.00

exiftool 7.30 reports a warning "Bad InteropIFD directory".

I added a length check as a hot fix:

seek $fh $pos start
}
+ if { $size > [ string length $value ] } continue
lappend return $tag [_format $byteOrder $value $format $components]
}
return $return

The actual problem is a bad pointer to the InteropIFD directory. Therefore,
a more general solution would be something like black list checking.

Are there any plans in this direction? I am going to implement one as
a work around for my own but may also post it as a proposal.

Discussion