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

tools/tiffcrop.c:7477:1: start of procedure createCroppedImage()
7475.  * the most optimized path when no Zones or Regions are required.
7476.  */
7477. static int
      ^
7478. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7479.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7482:3: 
7480.   {
7481.   tsize_t   cropsize;
7482.   unsigned  char *read_buff = NULL;
        ^
7483.   unsigned  char *crop_buff = NULL;
7484.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7483:3: 
7481.   tsize_t   cropsize;
7482.   unsigned  char *read_buff = NULL;
7483.   unsigned  char *crop_buff = NULL;
        ^
7484.   unsigned  char *new_buff  = NULL;
7485.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7484:3: 
7482.   unsigned  char *read_buff = NULL;
7483.   unsigned  char *crop_buff = NULL;
7484.   unsigned  char *new_buff  = NULL;
        ^
7485.   static    tsize_t  prev_cropsize = 0;
7486. 

tools/tiffcrop.c:7485:3: 
7483.   unsigned  char *crop_buff = NULL;
7484.   unsigned  char *new_buff  = NULL;
7485.   static    tsize_t  prev_cropsize = 0;
        ^
7486. 
7487.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7487:3: 
7485.   static    tsize_t  prev_cropsize = 0;
7486. 
7487.   read_buff = *read_buff_ptr;
        ^
7488. 
7489.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7490:3: 
7488. 
7489.   /* process full image, no crop buffer needed */
7490.   crop_buff = read_buff;
        ^
7491.   *crop_buff_ptr = read_buff;
7492.   crop->combined_width = image->width;

tools/tiffcrop.c:7491:3: 
7489.   /* process full image, no crop buffer needed */
7490.   crop_buff = read_buff;
7491.   *crop_buff_ptr = read_buff;
        ^
7492.   crop->combined_width = image->width;
7493.   crop->combined_length = image->length;

tools/tiffcrop.c:7492:3: 
7490.   crop_buff = read_buff;
7491.   *crop_buff_ptr = read_buff;
7492.   crop->combined_width = image->width;
        ^
7493.   crop->combined_length = image->length;
7494. 

tools/tiffcrop.c:7493:3: 
7491.   *crop_buff_ptr = read_buff;
7492.   crop->combined_width = image->width;
7493.   crop->combined_length = image->length;
        ^
7494. 
7495.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7495:3: 
7493.   crop->combined_length = image->length;
7494. 
7495.   cropsize = crop->bufftotal;
        ^
7496.   crop_buff = *crop_buff_ptr;
7497.   if (!crop_buff)

tools/tiffcrop.c:7496:3: 
7494. 
7495.   cropsize = crop->bufftotal;
7496.   crop_buff = *crop_buff_ptr;
        ^
7497.   if (!crop_buff)
7498.     {

tools/tiffcrop.c:7497:8: Taking true branch
7495.   cropsize = crop->bufftotal;
7496.   crop_buff = *crop_buff_ptr;
7497.   if (!crop_buff)
             ^
7498.     {
7499.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7499:5: 
7497.   if (!crop_buff)
7498.     {
7499.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
          ^
7500.     *crop_buff_ptr = crop_buff;
7501.     _TIFFmemset(crop_buff, 0, cropsize);

libtiff/tif_unix.c:277:1: start of procedure _TIFFmalloc()
  275. #endif
  276. 
  277. void*
       ^
  278. _TIFFmalloc(tmsize_t s)
  279. {

libtiff/tif_unix.c:280:13: Taking false branch
  278. _TIFFmalloc(tmsize_t s)
  279. {
  280.         if (s == 0)
                   ^
  281.                 return ((void *) NULL);
  282. 

libtiff/tif_unix.c:283:2: 
  281.                 return ((void *) NULL);
  282. 
  283. 	return (malloc((size_t) s));
        ^
  284. }
  285. 

libtiff/tif_unix.c:284:1: return from a call to _TIFFmalloc
  282. 
  283. 	return (malloc((size_t) s));
  284. }
       ^
  285. 
  286. void

tools/tiffcrop.c:7500:5: 
7498.     {
7499.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7500.     *crop_buff_ptr = crop_buff;
          ^
7501.     _TIFFmemset(crop_buff, 0, cropsize);
7502.     prev_cropsize = cropsize;

tools/tiffcrop.c:7501:5: 
7499.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7500.     *crop_buff_ptr = crop_buff;
7501.     _TIFFmemset(crop_buff, 0, cropsize);
          ^
7502.     prev_cropsize = cropsize;
7503.     }

libtiff/tif_unix.c:298:1: start of procedure _TIFFmemset()
  296. }
  297. 
  298. void
       ^
  299. _TIFFmemset(void* p, int v, tmsize_t c)
  300. {

libtiff/tif_unix.c:301:2: 
  299. _TIFFmemset(void* p, int v, tmsize_t c)
  300. {
  301. 	memset(p, v, (size_t) c);
        ^
  302. }
  303. 

libtiff/tif_unix.c:302:1: return from a call to _TIFFmemset
  300. {
  301. 	memset(p, v, (size_t) c);
  302. }
       ^
  303. 
  304. void
