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

tools/tiffcrop.c:7632:1: start of procedure createCroppedImage()
7630.  * the most optimized path when no Zones or Regions are required.
7631.  */
7632. static int
      ^
7633. createCroppedImage(struct image_data *image, struct crop_mask *crop, 
7634.                    unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr)

tools/tiffcrop.c:7637:3: 
7635.   {
7636.   tsize_t   cropsize;
7637.   unsigned  char *read_buff = NULL;
        ^
7638.   unsigned  char *crop_buff = NULL;
7639.   unsigned  char *new_buff  = NULL;

tools/tiffcrop.c:7638:3: 
7636.   tsize_t   cropsize;
7637.   unsigned  char *read_buff = NULL;
7638.   unsigned  char *crop_buff = NULL;
        ^
7639.   unsigned  char *new_buff  = NULL;
7640.   static    tsize_t  prev_cropsize = 0;

tools/tiffcrop.c:7639:3: 
7637.   unsigned  char *read_buff = NULL;
7638.   unsigned  char *crop_buff = NULL;
7639.   unsigned  char *new_buff  = NULL;
        ^
7640.   static    tsize_t  prev_cropsize = 0;
7641. 

tools/tiffcrop.c:7640:3: 
7638.   unsigned  char *crop_buff = NULL;
7639.   unsigned  char *new_buff  = NULL;
7640.   static    tsize_t  prev_cropsize = 0;
        ^
7641. 
7642.   read_buff = *read_buff_ptr;

tools/tiffcrop.c:7642:3: 
7640.   static    tsize_t  prev_cropsize = 0;
7641. 
7642.   read_buff = *read_buff_ptr;
        ^
7643. 
7644.   /* process full image, no crop buffer needed */

tools/tiffcrop.c:7645:3: 
7643. 
7644.   /* process full image, no crop buffer needed */
7645.   crop_buff = read_buff;
        ^
7646.   *crop_buff_ptr = read_buff;
7647.   crop->combined_width = image->width;

tools/tiffcrop.c:7646:3: 
7644.   /* process full image, no crop buffer needed */
7645.   crop_buff = read_buff;
7646.   *crop_buff_ptr = read_buff;
        ^
7647.   crop->combined_width = image->width;
7648.   crop->combined_length = image->length;

tools/tiffcrop.c:7647:3: 
7645.   crop_buff = read_buff;
7646.   *crop_buff_ptr = read_buff;
7647.   crop->combined_width = image->width;
        ^
7648.   crop->combined_length = image->length;
7649. 

tools/tiffcrop.c:7648:3: 
7646.   *crop_buff_ptr = read_buff;
7647.   crop->combined_width = image->width;
7648.   crop->combined_length = image->length;
        ^
7649. 
7650.   cropsize = crop->bufftotal;

tools/tiffcrop.c:7650:3: 
7648.   crop->combined_length = image->length;
7649. 
7650.   cropsize = crop->bufftotal;
        ^
7651.   crop_buff = *crop_buff_ptr;
7652.   if (!crop_buff)

tools/tiffcrop.c:7651:3: 
7649. 
7650.   cropsize = crop->bufftotal;
7651.   crop_buff = *crop_buff_ptr;
        ^
7652.   if (!crop_buff)
7653.     {

tools/tiffcrop.c:7652:8: Taking true branch
7650.   cropsize = crop->bufftotal;
7651.   crop_buff = *crop_buff_ptr;
7652.   if (!crop_buff)
             ^
7653.     {
7654.     crop_buff = (unsigned char *)limitMalloc(cropsize);

tools/tiffcrop.c:7654:5: 
7652.   if (!crop_buff)
7653.     {
7654.     crop_buff = (unsigned char *)limitMalloc(cropsize);
          ^
7655.     *crop_buff_ptr = crop_buff;
7656.     _TIFFmemset(crop_buff, 0, cropsize);

tools/tiffcrop.c:629:1: start of procedure limitMalloc()
  627.  * This custom malloc function enforce a maximum allocation size
  628.  */
  629. static void* limitMalloc(tmsize_t s)
       ^
  630. {
  631.   if (maxMalloc && (s > maxMalloc)) {

tools/tiffcrop.c:631:7: Taking true branch
  629. static void* limitMalloc(tmsize_t s)
  630. {
  631.   if (maxMalloc && (s > maxMalloc)) {
             ^
  632.     fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
  633.             (uint64)s, (uint64)maxMalloc);

tools/tiffcrop.c:631:21: Taking true branch
  629. static void* limitMalloc(tmsize_t s)
  630. {
  631.   if (maxMalloc && (s > maxMalloc)) {
                           ^
  632.     fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
  633.             (uint64)s, (uint64)maxMalloc);

tools/tiffcrop.c:632:5: 
  630. {
  631.   if (maxMalloc && (s > maxMalloc)) {
  632.     fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
           ^
  633.             (uint64)s, (uint64)maxMalloc);
  634.     fprintf(stderr, "                  use -k option to change limit.\n"); return NULL;

tools/tiffcrop.c:634:5: 
  632.     fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
  633.             (uint64)s, (uint64)maxMalloc);
  634.     fprintf(stderr, "                  use -k option to change limit.\n"); return NULL;
           ^
  635.   }
  636.   return _TIFFmalloc(s);

tools/tiffcrop.c:634:76: 
  632.     fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
  633.             (uint64)s, (uint64)maxMalloc);
  634.     fprintf(stderr, "                  use -k option to change limit.\n"); return NULL;
                                                                                  ^
  635.   }
  636.   return _TIFFmalloc(s);

tools/tiffcrop.c:637:1: return from a call to limitMalloc
  635.   }
  636.   return _TIFFmalloc(s);
  637. }
       ^
  638. 
  639. 

tools/tiffcrop.c:7655:5: 
7653.     {
7654.     crop_buff = (unsigned char *)limitMalloc(cropsize);
7655.     *crop_buff_ptr = crop_buff;
          ^
7656.     _TIFFmemset(crop_buff, 0, cropsize);
7657.     prev_cropsize = cropsize;

tools/tiffcrop.c:7656:5: 
7654.     crop_buff = (unsigned char *)limitMalloc(cropsize);
7655.     *crop_buff_ptr = crop_buff;
7656.     _TIFFmemset(crop_buff, 0, cropsize);
          ^
7657.     prev_cropsize = cropsize;
7658.     }

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
