summaryrefslogtreecommitdiff
path: root/tools/tiffcrop.c
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-28 02:16:08 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-28 02:16:08 +0000
commit022cd04c804894e4f9154b794b91df720b0ab6a0 (patch)
tree691278a894bb994966753f95a088c84c10af9212 /tools/tiffcrop.c
parent4d8fac3be8678073af539ae168d29694292659e2 (diff)
downloadlibtiff-git-022cd04c804894e4f9154b794b91df720b0ab6a0.tar.gz
(loadImage): Fix Coverity 1299741 "Dereference before null check".
Diffstat (limited to 'tools/tiffcrop.c')
-rw-r--r--tools/tiffcrop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
index 807de434..a28f49d0 100644
--- a/tools/tiffcrop.c
+++ b/tools/tiffcrop.c
@@ -1,4 +1,4 @@
-/* $Id: tiffcrop.c,v 1.30 2015-05-28 02:11:01 bfriesen Exp $ */
+/* $Id: tiffcrop.c,v 1.31 2015-05-28 02:16:08 bfriesen Exp $ */
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
@@ -6023,16 +6023,16 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
read_buff = new_buff;
}
}
- read_buff[buffsize] = 0;
- read_buff[buffsize+1] = 0;
- read_buff[buffsize+2] = 0;
-
if (!read_buff)
{
TIFFError("loadImage", "Unable to allocate/reallocate read buffer");
return (-1);
}
+ read_buff[buffsize] = 0;
+ read_buff[buffsize+1] = 0;
+ read_buff[buffsize+2] = 0;
+
prev_readsize = buffsize;
*read_ptr = read_buff;