tools/tiffcrop.c:7293: error: Null Dereference
  pointer `crop_buff` last assigned on line 7289 could be null and is dereferenced by call to `_TIFFmemset()` at line 7293, column 7.

tools/tiffcrop.c:7254:1: start of procedure createCroppedImage()
7252.  * the most optimized path when no Zones or Regions are required.
7253.  */
7254. static int
      ^
7255. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7256.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7259:3: 
7257.   {
7258.   tsize_t   cropsize;
7259.   unsigned  char *read_buff = NULL;
        ^
7260.   unsigned  char *crop_buff = NULL;
7261.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7260:3: 
7258.   tsize_t   cropsize;
7259.   unsigned  char *read_buff = NULL;
7260.   unsigned  char *crop_buff = NULL;
        ^
7261.   unsigned  char *new_buff  = NULL;
7262.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7261:3: 
7259.   unsigned  char *read_buff = NULL;
7260.   unsigned  char *crop_buff = NULL;
7261.   unsigned  char *new_buff  = NULL;
        ^
7262.   static    tsize_t  prev_cropsize = 0;
7263. 

tools/tiffcrop.c:7262:3: 
7260.   unsigned  char *crop_buff = NULL;
7261.   unsigned  char *new_buff  = NULL;
7262.   static    tsize_t  prev_cropsize = 0;
        ^
7263. 
7264.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7264:3: 
7262.   static    tsize_t  prev_cropsize = 0;
7263. 
7264.   read_buff = *read_buff_ptr;
        ^
7265. 
7266.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7267:3: 
7265. 
7266.   /* process full image, no crop buffer needed */
7267.   crop_buff = read_buff;
        ^
7268.   *crop_buff_ptr = read_buff;
7269.   crop->combined_width = image->width;

tools/tiffcrop.c:7268:3: 
7266.   /* process full image, no crop buffer needed */
7267.   crop_buff = read_buff;
7268.   *crop_buff_ptr = read_buff;
        ^
7269.   crop->combined_width = image->width;
7270.   crop->combined_length = image->length;

tools/tiffcrop.c:7269:3: 
7267.   crop_buff = read_buff;
7268.   *crop_buff_ptr = read_buff;
7269.   crop->combined_width = image->width;
        ^
7270.   crop->combined_length = image->length;
7271. 

tools/tiffcrop.c:7270:3: 
7268.   *crop_buff_ptr = read_buff;
7269.   crop->combined_width = image->width;
7270.   crop->combined_length = image->length;
        ^
7271. 
7272.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7272:3: 
7270.   crop->combined_length = image->length;
7271. 
7272.   cropsize = crop->bufftotal;
        ^
7273.   crop_buff = *crop_buff_ptr;
7274.   if (!crop_buff)

tools/tiffcrop.c:7273:3: 
7271. 
7272.   cropsize = crop->bufftotal;
7273.   crop_buff = *crop_buff_ptr;
        ^
7274.   if (!crop_buff)
7275.     {

tools/tiffcrop.c:7274:8: Taking false branch
7272.   cropsize = crop->bufftotal;
7273.   crop_buff = *crop_buff_ptr;
7274.   if (!crop_buff)
             ^
7275.     {
7276.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7283:9: Taking true branch
7281.   else
7282.     {
7283.     if (prev_cropsize < cropsize)
              ^
7284.       {
7285.       new_buff = _TIFFrealloc(crop_buff, cropsize);

tools/tiffcrop.c:7285:7: 
7283.     if (prev_cropsize < cropsize)
7284.       {
7285.       new_buff = _TIFFrealloc(crop_buff, cropsize);
            ^
7286.       if (!new_buff)
7287.         {

libtiff/tif_unix.c:265:1: start of procedure _TIFFrealloc()
  263. }
  264. 
  265. void*
       ^
  266. _TIFFrealloc(void* p, tmsize_t s)
  267. {

libtiff/tif_unix.c:268:2: 
  266. _TIFFrealloc(void* p, tmsize_t s)
  267. {
  268. 	return (realloc(p, (size_t) s));
        ^
  269. }
  270. 

libtiff/tif_unix.c:269:1: return from a call to _TIFFrealloc
  267. {
  268. 	return (realloc(p, (size_t) s));
  269. }
       ^
  270. 
  271. void

tools/tiffcrop.c:7286:12: Taking true branch
7284.       {
7285.       new_buff = _TIFFrealloc(crop_buff, cropsize);
7286.       if (!new_buff)
                 ^
7287.         {
7288. 	free (crop_buff);

tools/tiffcrop.c:7288:2: 
7286.       if (!new_buff)
7287.         {
7288. 	free (crop_buff);
       ^
7289.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7290.         }

tools/tiffcrop.c:7289:9: 
7287.         {
7288. 	free (crop_buff);
7289.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
              ^
7290.         }
7291.       else

libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc()
  251. #endif
  252. 
  253. void*
       ^
  254. _TIFFmalloc(tmsize_t s)
  255. {

libtiff/tif_unix.c:256:2: 
  254. _TIFFmalloc(tmsize_t s)
  255. {
  256. 	return (malloc((size_t) s));
        ^
  257. }
  258. 

libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc
  255. {
  256. 	return (malloc((size_t) s));
  257. }
       ^
  258. 
  259. void

tools/tiffcrop.c:7293:7: 
7291.       else
7292.         crop_buff = new_buff;
7293.       _TIFFmemset(crop_buff, 0, cropsize);
            ^
7294.       }
7295.     }

libtiff/tif_unix.c:271:1: start of procedure _TIFFmemset()
  269. }
  270. 
  271. void
       ^
  272. _TIFFmemset(void* p, int v, tmsize_t c)
  273. {

libtiff/tif_unix.c:274:2: 
  272. _TIFFmemset(void* p, int v, tmsize_t c)
  273. {
  274. 	memset(p, v, (size_t) c);
        ^
  275. }
  276. 

libtiff/tif_unix.c:275:1: return from a call to _TIFFmemset
  273. {
  274. 	memset(p, v, (size_t) c);
  275. }
       ^
  276. 
  277. void
