summaryrefslogtreecommitdiff
path: root/tools/tiffinfo.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2016-12-03 14:18:48 +0000
committerEven Rouault <even.rouault@spatialys.com>2016-12-03 14:18:48 +0000
commit2deb7183ca54cade2fe2bf369c816685dccb7385 (patch)
treebac910281d44be2fe6df2594e0cbba10f0d6f3d1 /tools/tiffinfo.c
parent4dc0503820b914d6c3ff1c28bf01dc78cb73ded5 (diff)
downloadlibtiff-git-2deb7183ca54cade2fe2bf369c816685dccb7385.tar.gz
* tools/tiffinfo.c: fix null pointer dereference in -r mode when the image has
no StripByteCount tag. Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2594
Diffstat (limited to 'tools/tiffinfo.c')
-rw-r--r--tools/tiffinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
index b02c7d46..4d58055d 100644
--- a/tools/tiffinfo.c
+++ b/tools/tiffinfo.c
@@ -1,4 +1,4 @@
-/* $Id: tiffinfo.c,v 1.25 2016-11-12 20:06:05 bfriesen Exp $ */
+/* $Id: tiffinfo.c,v 1.26 2016-12-03 14:18:49 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -417,7 +417,7 @@ TIFFReadRawData(TIFF* tif, int bitrev)
uint64* stripbc=NULL;
TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbc);
- if (nstrips > 0) {
+ if (stripbc != NULL && nstrips > 0) {
uint32 bufsize = (uint32) stripbc[0];
tdata_t buf = _TIFFmalloc(bufsize);
tstrip_t s;