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

tools/tiffcrop.c:7605:1: start of procedure createCroppedImage()
7603.  * the most optimized path when no Zones or Regions are required.
7604.  */
7605. static int
      ^
7606. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7607.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7610:3: 
7608.   {
7609.   tsize_t   cropsize;
7610.   unsigned  char *read_buff = NULL;
        ^
7611.   unsigned  char *crop_buff = NULL;
7612.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7611:3: 
7609.   tsize_t   cropsize;
7610.   unsigned  char *read_buff = NULL;
7611.   unsigned  char *crop_buff = NULL;
        ^
7612.   unsigned  char *new_buff  = NULL;
7613.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7612:3: 
7610.   unsigned  char *read_buff = NULL;
7611.   unsigned  char *crop_buff = NULL;
7612.   unsigned  char *new_buff  = NULL;
        ^
7613.   static    tsize_t  prev_cropsize = 0;
7614. 

tools/tiffcrop.c:7613:3: 
7611.   unsigned  char *crop_buff = NULL;
7612.   unsigned  char *new_buff  = NULL;
7613.   static    tsize_t  prev_cropsize = 0;
        ^
7614. 
7615.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7615:3: 
7613.   static    tsize_t  prev_cropsize = 0;
7614. 
7615.   read_buff = *read_buff_ptr;
        ^
7616. 
7617.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7618:3: 
7616. 
7617.   /* process full image, no crop buffer needed */
7618.   crop_buff = read_buff;
        ^
7619.   *crop_buff_ptr = read_buff;
7620.   crop->combined_width = image->width;

tools/tiffcrop.c:7619:3: 
7617.   /* process full image, no crop buffer needed */
7618.   crop_buff = read_buff;
7619.   *crop_buff_ptr = read_buff;
        ^
7620.   crop->combined_width = image->width;
7621.   crop->combined_length = image->length;

tools/tiffcrop.c:7620:3: 
7618.   crop_buff = read_buff;
7619.   *crop_buff_ptr = read_buff;
7620.   crop->combined_width = image->width;
        ^
7621.   crop->combined_length = image->length;
7622. 

tools/tiffcrop.c:7621:3: 
7619.   *crop_buff_ptr = read_buff;
7620.   crop->combined_width = image->width;
7621.   crop->combined_length = image->length;
        ^
7622. 
7623.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7623:3: 
7621.   crop->combined_length = image->length;
7622. 
7623.   cropsize = crop->bufftotal;
        ^
7624.   crop_buff = *crop_buff_ptr;
7625.   if (!crop_buff)

tools/tiffcrop.c:7624:3: 
7622. 
7623.   cropsize = crop->bufftotal;
7624.   crop_buff = *crop_buff_ptr;
        ^
7625.   if (!crop_buff)
7626.     {

tools/tiffcrop.c:7625:8: Taking true branch
7623.   cropsize = crop->bufftotal;
7624.   crop_buff = *crop_buff_ptr;
7625.   if (!crop_buff)
             ^
7626.     {
7627.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7627:5: 
7625.   if (!crop_buff)
7626.     {
7627.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
          ^
7628.     *crop_buff_ptr = crop_buff;
7629.     _TIFFmemset(crop_buff, 0, cropsize);

libtiff/tif_unix.c:308:1: start of procedure _TIFFmalloc()
  306. #endif
  307. 
  308. void*
       ^
  309. _TIFFmalloc(tmsize_t s)
  310. {

libtiff/tif_unix.c:311:13: Taking false branch
  309. _TIFFmalloc(tmsize_t s)
  310. {
  311.         if (s == 0)
                   ^
  312.                 return ((void *) NULL);
  313. 

libtiff/tif_unix.c:314:2: 
  312.                 return ((void *) NULL);
  313. 
  314. 	return (malloc((size_t) s));
        ^
  315. }
  316. 

libtiff/tif_unix.c:315:1: return from a call to _TIFFmalloc
  313. 
  314. 	return (malloc((size_t) s));
  315. }
       ^
  316. 
  317. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)

tools/tiffcrop.c:7628:5: 
7626.     {
7627.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7628.     *crop_buff_ptr = crop_buff;
          ^
7629.     _TIFFmemset(crop_buff, 0, cropsize);
7630.     prev_cropsize = cropsize;

tools/tiffcrop.c:7629:5: 
7627.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7628.     *crop_buff_ptr = crop_buff;
7629.     _TIFFmemset(crop_buff, 0, cropsize);
          ^
7630.     prev_cropsize = cropsize;
7631.     }

libtiff/tif_unix.c:337:1: start of procedure _TIFFmemset()
  335. }
  336. 
  337. void
       ^
  338. _TIFFmemset(void* p, int v, tmsize_t c)
  339. {

libtiff/tif_unix.c:340:2: 
  338. _TIFFmemset(void* p, int v, tmsize_t c)
  339. {
  340. 	memset(p, v, (size_t) c);
        ^
  341. }
  342. 

libtiff/tif_unix.c:341:1: return from a call to _TIFFmemset
  339. {
  340. 	memset(p, v, (size_t) c);
  341. }
       ^
  342. 
  343. void
