Re: tiff with jpeg compression

Michal Kowalczuk <[email protected]> Fri, 9 Sep 2005 18:30:13 +0200
Newsgroups gmane.comp.video.graphicsmagick.bugs
Organization Drużyna Pingwina
Message-ID <[email protected]>
On 2004-03-26, Bob Friesenhahn <[email protected]> wrote:

>> at first - thanks for your reply. i didn't know, that graphicsmagick
>> realy crashs with this pic, i also got a exception. (i forgot to say
>> that i'm using gm-1.0.4 and work with a pentium 4 - 2,5ghz and winxp)

I don't know if my problem is related to this thread, but it looks similar.
My configuration is: SPARC64, Solaris 10, gm-1.1.6, libtiff-3.7.3.
I found that gm crashes on:
#v+
if (TIFFGetField(tiff,TIFFTAG_DATETIME,&text) == 1)
#v-
(coders/tiff.c, line 748)

libtiff treats it as a "Custom value", tag code == 36867 and returns two
values via va_arg (count and value), while gm expects one value (only value,
no count).

#v+
if (fip->field_readcount == TIFF_VARIABLE2)
  *va_arg(ap, uint32*) = (uint32)tv->count; // <- this...
else    /* Assume TIFF_VARIABLE */
  *va_arg(ap, uint16*) = (uint16)tv->count; // <- ...or this returns count
*va_arg(ap, void **) = tv->value;   // <- this returns value
#v-
(libtiff/tif_dir.c, line 932)

So I think that all "Custom values" should be got this way:
#v+
if (TIFFGetField(tiff,TIFFTAG_DATETIME,&length,&text) == 1)
#v-

Strange is that I've observed this bug on:
* SPARC64, Solaris 10 (always)
* then on x86, Solaris 10 (only once, after "make clean; make" of my
  application it never crashed again),
* never on x86, Linux (am I lucky? ;])

-- 
 _  <= Michal Kowalczuk => <== (http://)|(mailto:sammael@)brzydal.eu.org/? ==>
( ` <= GG#2113900 => <==== Mff pmfmffpmpmpp mfmmffpffpmffmm fppmfffmpmfp ====>
 \  /||\ /||\ /||\ |~~| <== mmpmffmfm mpfmmmfmp fmpmfffmpfmpmffmppfmm [...] =>
,_)/~|| ` || ` ||~\|~_|_   <========================= --Kenny, South Park ===>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf