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

tools/tiffcrop.c:7600:1: start of procedure createCroppedImage()
7598.  * the most optimized path when no Zones or Regions are required.
7599.  */
7600. static int
      ^
7601. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7602.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7605:3: 
7603.   {
7604.   tsize_t   cropsize;
7605.   unsigned  char *read_buff = NULL;
        ^
7606.   unsigned  char *crop_buff = NULL;
7607.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7606:3: 
7604.   tsize_t   cropsize;
7605.   unsigned  char *read_buff = NULL;
7606.   unsigned  char *crop_buff = NULL;
        ^
7607.   unsigned  char *new_buff  = NULL;
7608.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7607:3: 
7605.   unsigned  char *read_buff = NULL;
7606.   unsigned  char *crop_buff = NULL;
7607.   unsigned  char *new_buff  = NULL;
        ^
7608.   static    tsize_t  prev_cropsize = 0;
7609. 

tools/tiffcrop.c:7608:3: 
7606.   unsigned  char *crop_buff = NULL;
7607.   unsigned  char *new_buff  = NULL;
7608.   static    tsize_t  prev_cropsize = 0;
        ^
7609. 
7610.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7610:3: 
7608.   static    tsize_t  prev_cropsize = 0;
7609. 
7610.   read_buff = *read_buff_ptr;
        ^
7611. 
7612.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7613:3: 
7611. 
7612.   /* process full image, no crop buffer needed */
7613.   crop_buff = read_buff;
        ^
7614.   *crop_buff_ptr = read_buff;
7615.   crop->combined_width = image->width;

tools/tiffcrop.c:7614:3: 
7612.   /* process full image, no crop buffer needed */
7613.   crop_buff = read_buff;
7614.   *crop_buff_ptr = read_buff;
        ^
7615.   crop->combined_width = image->width;
7616.   crop->combined_length = image->length;

tools/tiffcrop.c:7615:3: 
7613.   crop_buff = read_buff;
7614.   *crop_buff_ptr = read_buff;
7615.   crop->combined_width = image->width;
        ^
7616.   crop->combined_length = image->length;
7617. 

tools/tiffcrop.c:7616:3: 
7614.   *crop_buff_ptr = read_buff;
7615.   crop->combined_width = image->width;
7616.   crop->combined_length = image->length;
        ^
7617. 
7618.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7618:3: 
7616.   crop->combined_length = image->length;
7617. 
7618.   cropsize = crop->bufftotal;
        ^
7619.   crop_buff = *crop_buff_ptr;
7620.   if (!crop_buff)

tools/tiffcrop.c:7619:3: 
7617. 
7618.   cropsize = crop->bufftotal;
7619.   crop_buff = *crop_buff_ptr;
        ^
7620.   if (!crop_buff)
7621.     {

tools/tiffcrop.c:7620:8: Taking false branch
7618.   cropsize = crop->bufftotal;
7619.   crop_buff = *crop_buff_ptr;
7620.   if (!crop_buff)
             ^
7621.     {
7622.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7629:9: Taking true branch
7627.   else
7628.     {
7629.     if (prev_cropsize < cropsize)
              ^
7630.       {
7631.       new_buff = _TIFFrealloc(crop_buff, cropsize);

tools/tiffcrop.c:7631:7: 
7629.     if (prev_cropsize < cropsize)
7630.       {
7631.       new_buff = _TIFFrealloc(crop_buff, cropsize);
            ^
7632.       if (!new_buff)
7633.         {

libtiff/tif_unix.c:331:1: start of procedure _TIFFrealloc()
  329. }
  330. 
  331. void*
       ^
  332. _TIFFrealloc(void* p, tmsize_t s)
  333. {

libtiff/tif_unix.c:334:2: 
  332. _TIFFrealloc(void* p, tmsize_t s)
  333. {
  334. 	return (realloc(p, (size_t) s));
        ^
  335. }
  336. 

libtiff/tif_unix.c:335:1: return from a call to _TIFFrealloc
  333. {
  334. 	return (realloc(p, (size_t) s));
  335. }
       ^
  336. 
  337. void

tools/tiffcrop.c:7632:12: Taking true branch
7630.       {
7631.       new_buff = _TIFFrealloc(crop_buff, cropsize);
7632.       if (!new_buff)
                 ^
7633.         {
7634. 	free (crop_buff);

tools/tiffcrop.c:7634:2: 
7632.       if (!new_buff)
7633.         {
7634. 	free (crop_buff);
       ^
7635.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7636.         }

tools/tiffcrop.c:7635:9: 
7633.         {
7634. 	free (crop_buff);
7635.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
              ^
7636.         }
7637.       else

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:7639:7: 
7637.       else
7638.         crop_buff = new_buff;
7639.       _TIFFmemset(crop_buff, 0, cropsize);
            ^
7640.       }
7641.     }

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
