AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2005.12.12 21:32 "Bug in tiffcp (unsupported codecs return 0)", by Jason Frank
2005.12.13 19:53 "Re: Bug in tiffcp (unsupported codecs return 0)", by Jason Frank
2005.12.13 20:09 "Re: Bug in tiffcp (unsupported codecs return 0)", by Andrey Kiselev
2005.12.13 21:11 "Re: Bug in tiffcp (unsupported codecs return 0)", by Jason Frank
2005.12.13 21:46 "Re: Bug in tiffcp (unsupported codecs return 0)", by Andrey Kiselev
2005.12.13 23:32 "Re: Bug in tiffcp (unsupported codecs return 0)", by Edward Lam
2005.12.14 02:34 "Re: Bug in tiffcp (unsupported codecs return 0)", by Jason Frank

2005.12.13 19:53 "Re: Bug in tiffcp (unsupported codecs return 0)", by Jason Frank

So, if I apply this patch to my tiffcp.c, it makes my test case work
correctly:

--- ../tiff-3.7.4-orig/tools/tiffcp.c   2005-07-08 04:03:49.000000000
-0500
+++ tools/tiffcp.c      2005-12-13 10:45:23.000000000 -0600
@@ -852,8 +852,10 @@
                for (s = 0; s < ns; s++) {
                        tsize_t cc = (row + rowsperstrip > imagelength)
?
                            TIFFVStripSize(in, imagelength - row) :
stripsize;
-                       if (TIFFReadEncodedStrip(in, s, buf, cc) < 0 &&
!ignore)
-                               break;
+                       if (TIFFReadEncodedStrip(in, s, buf, cc) < 0 &&
!ignore) {
+                         _TIFFfree(buf);
+                         return FALSE;
+                       }
                        if (TIFFWriteEncodedStrip(out, s, buf, cc) < 0)
{
                                _TIFFfree(buf);
                                return (FALSE);

This same issue appears to be present in all of the cpFunc's, athough
they're all coded slightly differently.  I suppose we could have to do
that to all the cpFuncs (and possibly some others...)

I'm worried that this is not the correct fix.  Can someone tell me if
I'm barking up the right tree?

Also, I've noticed that when this happens, we do not unlink the new TIF
that we're creating (assuming that we're not appending.)  That's a
pretty easy fix.  Any interest in doing that?

Jason