From 1a5dfd22054f089a4f8a8cc9d7d3497ca8ecc9ef Mon Sep 17 00:00:00 2001 From: Joris Van Damme Date: Wed, 24 Oct 2007 10:19:42 +0000 Subject: [PATCH] tif_dirread.c: Fixed problem with bogus file triggering assert in ChopUpSingleUncompressedStrip --- ChangeLog | 6 ++++++ libtiff/tif_dirread.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c52a368d..8db8cf85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-24 Joris Van Damme + + * tif_dirread.c: Fixed problem with bogus file triggering + assert(td->td_planarconfig == PLANARCONFIG_CONTIG) in + ChopUpSingleUncompressedStrip + 2007-10-22 Joris Van Damme * tif_jpeg.c: Resolved buffer incrementation bug that lead to faulty images diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 3b3ab4b3..31604c02 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.134 2007-09-29 10:34:38 joris Exp $ */ +/* $Id: tif_dirread.c,v 1.135 2007-10-24 10:20:23 joris Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -3868,8 +3868,10 @@ TIFFReadDirectory(TIFF* tif) * side effect, however, is that the RowsPerStrip tag * value may be changed. */ - if (tif->tif_dir.td_nstrips == 1 && tif->tif_dir.td_compression == COMPRESSION_NONE && - (tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP) + if ((tif->tif_dir.td_planarconfig==PLANARCONFIG_CONTIG)&& + (tif->tif_dir.td_nstrips==1)&& + (tif->tif_dir.td_compression==COMPRESSION_NONE)&& + ((tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED))==TIFF_STRIPCHOP)) ChopUpSingleUncompressedStrip(tif); /*