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

tools/tiffcrop.c:7592:1: start of procedure createCroppedImage()
7590.  * the most optimized path when no Zones or Regions are required.
7591.  */
7592. static int
      ^
7593. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7594.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7597:3: 
7595.   {
7596.   tsize_t   cropsize;
7597.   unsigned  char *read_buff = NULL;
        ^
7598.   unsigned  char *crop_buff = NULL;
7599.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7598:3: 
7596.   tsize_t   cropsize;
7597.   unsigned  char *read_buff = NULL;
7598.   unsigned  char *crop_buff = NULL;
        ^
7599.   unsigned  char *new_buff  = NULL;
7600.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7599:3: 
7597.   unsigned  char *read_buff = NULL;
7598.   unsigned  char *crop_buff = NULL;
7599.   unsigned  char *new_buff  = NULL;
        ^
7600.   static    tsize_t  prev_cropsize = 0;
7601. 

tools/tiffcrop.c:7600:3: 
7598.   unsigned  char *crop_buff = NULL;
7599.   unsigned  char *new_buff  = NULL;
7600.   static    tsize_t  prev_cropsize = 0;
        ^
7601. 
7602.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7602:3: 
7600.   static    tsize_t  prev_cropsize = 0;
7601. 
7602.   read_buff = *read_buff_ptr;
        ^
7603. 
7604.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7605:3: 
7603. 
7604.   /* process full image, no crop buffer needed */
7605.   crop_buff = read_buff;
        ^
7606.   *crop_buff_ptr = read_buff;
7607.   crop->combined_width = image->width;

tools/tiffcrop.c:7606:3: 
7604.   /* process full image, no crop buffer needed */
7605.   crop_buff = read_buff;
7606.   *crop_buff_ptr = read_buff;
        ^
7607.   crop->combined_width = image->width;
7608.   crop->combined_length = image->length;

tools/tiffcrop.c:7607:3: 
7605.   crop_buff = read_buff;
7606.   *crop_buff_ptr = read_buff;
7607.   crop->combined_width = image->width;
        ^
7608.   crop->combined_length = image->length;
7609. 

tools/tiffcrop.c:7608:3: 
7606.   *crop_buff_ptr = read_buff;
7607.   crop->combined_width = image->width;
7608.   crop->combined_length = image->length;
        ^
7609. 
7610.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7610:3: 
7608.   crop->combined_length = image->length;
7609. 
7610.   cropsize = crop->bufftotal;
        ^
7611.   crop_buff = *crop_buff_ptr;
7612.   if (!crop_buff)

tools/tiffcrop.c:7611:3: 
7609. 
7610.   cropsize = crop->bufftotal;
7611.   crop_buff = *crop_buff_ptr;
        ^
7612.   if (!crop_buff)
7613.     {

tools/tiffcrop.c:7612:8: Taking false branch
7610.   cropsize = crop->bufftotal;
7611.   crop_buff = *crop_buff_ptr;
7612.   if (!crop_buff)
             ^
7613.     {
7614.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7621:9: Taking true branch
7619.   else
7620.     {
7621.     if (prev_cropsize < cropsize)
              ^
7622.       {
7623.       new_buff = _TIFFrealloc(crop_buff, cropsize);

tools/tiffcrop.c:7623:7: 
7621.     if (prev_cropsize < cropsize)
7622.       {
7623.       new_buff = _TIFFrealloc(crop_buff, cropsize);
            ^
7624.       if (!new_buff)
7625.         {

libtiff/tif_unix.c:325:1: start of procedure _TIFFrealloc()
  323. }
  324. 
  325. void*
       ^
  326. _TIFFrealloc(void* p, tmsize_t s)
  327. {

libtiff/tif_unix.c:328:2: 
  326. _TIFFrealloc(void* p, tmsize_t s)
  327. {
  328. 	return (realloc(p, (size_t) s));
        ^
  329. }
  330. 

libtiff/tif_unix.c:329:1: return from a call to _TIFFrealloc
  327. {
  328. 	return (realloc(p, (size_t) s));
  329. }
       ^
  330. 
  331. void

tools/tiffcrop.c:7624:12: Taking true branch
7622.       {
7623.       new_buff = _TIFFrealloc(crop_buff, cropsize);
7624.       if (!new_buff)
                 ^
7625.         {
7626. 	free (crop_buff);

tools/tiffcrop.c:7626:2: 
7624.       if (!new_buff)
7625.         {
7626. 	free (crop_buff);
       ^
7627.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7628.         }

tools/tiffcrop.c:7627:9: 
7625.         {
7626. 	free (crop_buff);
7627.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
              ^
7628.         }
7629.       else

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

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

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

libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc
  315. 
  316. 	return (malloc((size_t) s));
  317. }
       ^
  318. 
  319. void

tools/tiffcrop.c:7631:7: 
7629.       else
7630.         crop_buff = new_buff;
7631.       _TIFFmemset(crop_buff, 0, cropsize);
            ^
7632.       }
7633.     }

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

libtiff/tif_unix.c:334:2: 
  332. _TIFFmemset(void* p, int v, tmsize_t c)
  333. {
  334. 	memset(p, v, (size_t) c);
        ^
  335. }
  336. 

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