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

tools/tiffcrop.c:7467:1: start of procedure createCroppedImage()
7465.  * the most optimized path when no Zones or Regions are required.
7466.  */
7467. static int
      ^
7468. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7469.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7472:3: 
7470.   {
7471.   tsize_t   cropsize;
7472.   unsigned  char *read_buff = NULL;
        ^
7473.   unsigned  char *crop_buff = NULL;
7474.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7473:3: 
7471.   tsize_t   cropsize;
7472.   unsigned  char *read_buff = NULL;
7473.   unsigned  char *crop_buff = NULL;
        ^
7474.   unsigned  char *new_buff  = NULL;
7475.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7474:3: 
7472.   unsigned  char *read_buff = NULL;
7473.   unsigned  char *crop_buff = NULL;
7474.   unsigned  char *new_buff  = NULL;
        ^
7475.   static    tsize_t  prev_cropsize = 0;
7476. 

tools/tiffcrop.c:7475:3: 
7473.   unsigned  char *crop_buff = NULL;
7474.   unsigned  char *new_buff  = NULL;
7475.   static    tsize_t  prev_cropsize = 0;
        ^
7476. 
7477.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7477:3: 
7475.   static    tsize_t  prev_cropsize = 0;
7476. 
7477.   read_buff = *read_buff_ptr;
        ^
7478. 
7479.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7480:3: 
7478. 
7479.   /* process full image, no crop buffer needed */
7480.   crop_buff = read_buff;
        ^
7481.   *crop_buff_ptr = read_buff;
7482.   crop->combined_width = image->width;

tools/tiffcrop.c:7481:3: 
7479.   /* process full image, no crop buffer needed */
7480.   crop_buff = read_buff;
7481.   *crop_buff_ptr = read_buff;
        ^
7482.   crop->combined_width = image->width;
7483.   crop->combined_length = image->length;

tools/tiffcrop.c:7482:3: 
7480.   crop_buff = read_buff;
7481.   *crop_buff_ptr = read_buff;
7482.   crop->combined_width = image->width;
        ^
7483.   crop->combined_length = image->length;
7484. 

tools/tiffcrop.c:7483:3: 
7481.   *crop_buff_ptr = read_buff;
7482.   crop->combined_width = image->width;
7483.   crop->combined_length = image->length;
        ^
7484. 
7485.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7485:3: 
7483.   crop->combined_length = image->length;
7484. 
7485.   cropsize = crop->bufftotal;
        ^
7486.   crop_buff = *crop_buff_ptr;
7487.   if (!crop_buff)

tools/tiffcrop.c:7486:3: 
7484. 
7485.   cropsize = crop->bufftotal;
7486.   crop_buff = *crop_buff_ptr;
        ^
7487.   if (!crop_buff)
7488.     {

tools/tiffcrop.c:7487:8: Taking false branch
7485.   cropsize = crop->bufftotal;
7486.   crop_buff = *crop_buff_ptr;
7487.   if (!crop_buff)
             ^
7488.     {
7489.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7496:9: Taking true branch
7494.   else
7495.     {
7496.     if (prev_cropsize < cropsize)
              ^
7497.       {
7498.       new_buff = _TIFFrealloc(crop_buff, cropsize);

tools/tiffcrop.c:7498:7: 
7496.     if (prev_cropsize < cropsize)
7497.       {
7498.       new_buff = _TIFFrealloc(crop_buff, cropsize);
            ^
7499.       if (!new_buff)
7500.         {

libtiff/tif_unix.c:272:1: start of procedure _TIFFrealloc()
  270. }
  271. 
  272. void*
       ^
  273. _TIFFrealloc(void* p, tmsize_t s)
  274. {

libtiff/tif_unix.c:275:2: 
  273. _TIFFrealloc(void* p, tmsize_t s)
  274. {
  275. 	return (realloc(p, (size_t) s));
        ^
  276. }
  277. 

libtiff/tif_unix.c:276:1: return from a call to _TIFFrealloc
  274. {
  275. 	return (realloc(p, (size_t) s));
  276. }
       ^
  277. 
  278. void

tools/tiffcrop.c:7499:12: Taking true branch
7497.       {
7498.       new_buff = _TIFFrealloc(crop_buff, cropsize);
7499.       if (!new_buff)
                 ^
7500.         {
7501. 	free (crop_buff);

tools/tiffcrop.c:7501:2: 
7499.       if (!new_buff)
7500.         {
7501. 	free (crop_buff);
       ^
7502.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7503.         }

tools/tiffcrop.c:7502:9: 
7500.         {
7501. 	free (crop_buff);
7502.         crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
              ^
7503.         }
7504.       else

libtiff/tif_unix.c:257:1: start of procedure _TIFFmalloc()
  255. #endif
  256. 
  257. void*
       ^
  258. _TIFFmalloc(tmsize_t s)
  259. {

libtiff/tif_unix.c:260:13: Taking false branch
  258. _TIFFmalloc(tmsize_t s)
  259. {
  260.         if (s == 0)
                   ^
  261.                 return ((void *) NULL);
  262. 

libtiff/tif_unix.c:263:2: 
  261.                 return ((void *) NULL);
  262. 
  263. 	return (malloc((size_t) s));
        ^
  264. }
  265. 

libtiff/tif_unix.c:264:1: return from a call to _TIFFmalloc
  262. 
  263. 	return (malloc((size_t) s));
  264. }
       ^
  265. 
  266. void

tools/tiffcrop.c:7506:7: 
7504.       else
7505.         crop_buff = new_buff;
7506.       _TIFFmemset(crop_buff, 0, cropsize);
            ^
7507.       }
7508.     }

libtiff/tif_unix.c:278:1: start of procedure _TIFFmemset()
  276. }
  277. 
  278. void
       ^
  279. _TIFFmemset(void* p, int v, tmsize_t c)
  280. {

libtiff/tif_unix.c:281:2: 
  279. _TIFFmemset(void* p, int v, tmsize_t c)
  280. {
  281. 	memset(p, v, (size_t) c);
        ^
  282. }
  283. 

libtiff/tif_unix.c:282:1: return from a call to _TIFFmemset
  280. {
  281. 	memset(p, v, (size_t) c);
  282. }
       ^
  283. 
  284. void
