From e7bdb1894931ff99ea58800d56a8a3ab3dfaa94a Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Thu, 6 Sep 2001 19:28:45 +0000 Subject: [PATCH] fixed memory overrun in packbits decode --- ChangeLog | 6 ++++++ libtiff/tif_packbits.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f222d75a..9a029cc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-09-06 Frank Warmerdam + + * libtiff/tif_packbits.c: fixed memory overrun error. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=77 + 2001-08-31 Frank Warmerdam * libtiff/tif_getimage.c: relax handling of contig case where diff --git a/libtiff/tif_packbits.c b/libtiff/tif_packbits.c index 48c613da..e94ba3e7 100644 --- a/libtiff/tif_packbits.c +++ b/libtiff/tif_packbits.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_packbits.c,v 1.4 2000-10-20 16:33:51 warmerda Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_packbits.c,v 1.5 2001-09-06 19:28:45 warmerda Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -244,6 +244,7 @@ PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) "PackBitsDecode: discarding %d bytes " "to avoid buffer overrun", n - occ); + n = occ; } occ -= n; b = *bp++, cc--;