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

tools/tiffcrop.c:7442:1: start of procedure createCroppedImage()
7440.  * the most optimized path when no Zones or Regions are required.
7441.  */
7442. static int
      ^
7443. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7444.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7447:3: 
7445.   {
7446.   tsize_t   cropsize;
7447.   unsigned  char *read_buff = NULL;
        ^
7448.   unsigned  char *crop_buff = NULL;
7449.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7448:3: 
7446.   tsize_t   cropsize;
7447.   unsigned  char *read_buff = NULL;
7448.   unsigned  char *crop_buff = NULL;
        ^
7449.   unsigned  char *new_buff  = NULL;
7450.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7449:3: 
7447.   unsigned  char *read_buff = NULL;
7448.   unsigned  char *crop_buff = NULL;
7449.   unsigned  char *new_buff  = NULL;
        ^
7450.   static    tsize_t  prev_cropsize = 0;
7451. 

tools/tiffcrop.c:7450:3: 
7448.   unsigned  char *crop_buff = NULL;
7449.   unsigned  char *new_buff  = NULL;
7450.   static    tsize_t  prev_cropsize = 0;
        ^
7451. 
7452.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7452:3: 
7450.   static    tsize_t  prev_cropsize = 0;
7451. 
7452.   read_buff = *read_buff_ptr;
        ^
7453. 
7454.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7455:3: 
7453. 
7454.   /* process full image, no crop buffer needed */
7455.   crop_buff = read_buff;
        ^
7456.   *crop_buff_ptr = read_buff;
7457.   crop->combined_width = image->width;

tools/tiffcrop.c:7456:3: 
7454.   /* process full image, no crop buffer needed */
7455.   crop_buff = read_buff;
7456.   *crop_buff_ptr = read_buff;
        ^
7457.   crop->combined_width = image->width;
7458.   crop->combined_length = image->length;

tools/tiffcrop.c:7457:3: 
7455.   crop_buff = read_buff;
7456.   *crop_buff_ptr = read_buff;
7457.   crop->combined_width = image->width;
        ^
7458.   crop->combined_length = image->length;
7459. 

tools/tiffcrop.c:7458:3: 
7456.   *crop_buff_ptr = read_buff;
7457.   crop->combined_width = image->width;
7458.   crop->combined_length = image->length;
        ^
7459. 
7460.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7460:3: 
7458.   crop->combined_length = image->length;
7459. 
7460.   cropsize = crop->bufftotal;
        ^
7461.   crop_buff = *crop_buff_ptr;
7462.   if (!crop_buff)

tools/tiffcrop.c:7461:3: 
7459. 
7460.   cropsize = crop->bufftotal;
7461.   crop_buff = *crop_buff_ptr;
        ^
7462.   if (!crop_buff)
7463.     {

tools/tiffcrop.c:7462:8: Taking true branch
7460.   cropsize = crop->bufftotal;
7461.   crop_buff = *crop_buff_ptr;
7462.   if (!crop_buff)
             ^
7463.     {
7464.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);

tools/tiffcrop.c:7464:5: 
7462.   if (!crop_buff)
7463.     {
7464.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
          ^
7465.     *crop_buff_ptr = crop_buff;
7466.     _TIFFmemset(crop_buff, 0, cropsize);

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:7465:5: 
7463.     {
7464.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7465.     *crop_buff_ptr = crop_buff;
          ^
7466.     _TIFFmemset(crop_buff, 0, cropsize);
7467.     prev_cropsize = cropsize;

tools/tiffcrop.c:7466:5: 
7464.     crop_buff = (unsigned char *)_TIFFmalloc(cropsize);
7465.     *crop_buff_ptr = crop_buff;
7466.     _TIFFmemset(crop_buff, 0, cropsize);
          ^
7467.     prev_cropsize = cropsize;
7468.     }

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
