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

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

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

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

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

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

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

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

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

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

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

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

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

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

tools/tiffcrop.c:7629:5: 
7627.   if (!crop_buff)
7628.     {
7629.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
          ^
7630.     *crop_buff_ptr = crop_buff;
7631.     _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:7630:5: 
7628.     {
7629.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7630.     *crop_buff_ptr = crop_buff;
          ^
7631.     _TIFFmemset(crop_buff, 0, cropsize);
7632.     prev_cropsize = cropsize;

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

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
