tools/tiffcrop.c:8403: error: Memory Leak
  memory dynamically allocated by call to `_TIFFmalloc()` at line 8250, column 34 is not reachable after line 8403, column 5.

tools/tiffcrop.c:8204:1: start of procedure rotateImage()
8202. 
8203. /* Rotate an image by a multiple of 90 degrees clockwise */
8204. static int
      ^
8205. rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width, 
8206.             uint32 *img_length, unsigned char **ibuff_ptr)

tools/tiffcrop.c:8218:3: 
8216.   uint16   spp, bps;
8217.   float    res_temp;
8218.   unsigned char *rbuff = NULL;
        ^
8219. 
8220.   width  = *img_width;

tools/tiffcrop.c:8220:3: 
8218.   unsigned char *rbuff = NULL;
8219. 
8220.   width  = *img_width;
        ^
8221.   length = *img_length;
8222.   spp = image->spp;

tools/tiffcrop.c:8221:3: 
8219. 
8220.   width  = *img_width;
8221.   length = *img_length;
        ^
8222.   spp = image->spp;
8223.   bps = image->bps;

tools/tiffcrop.c:8222:3: 
8220.   width  = *img_width;
8221.   length = *img_length;
8222.   spp = image->spp;
        ^
8223.   bps = image->bps;
8224. 

tools/tiffcrop.c:8223:3: 
8221.   length = *img_length;
8222.   spp = image->spp;
8223.   bps = image->bps;
        ^
8224. 
8225.   rowsize = ((bps * spp * width) + 7) / 8;

tools/tiffcrop.c:8225:3: 
8223.   bps = image->bps;
8224. 
8225.   rowsize = ((bps * spp * width) + 7) / 8;
        ^
8226.   colsize = ((bps * spp * length) + 7) / 8;
8227.   if ((colsize * width) > (rowsize * length))

tools/tiffcrop.c:8226:3: 
8224. 
8225.   rowsize = ((bps * spp * width) + 7) / 8;
8226.   colsize = ((bps * spp * length) + 7) / 8;
        ^
8227.   if ((colsize * width) > (rowsize * length))
8228.     buffsize = (colsize + 1) * width;

tools/tiffcrop.c:8227:7: Taking true branch
8225.   rowsize = ((bps * spp * width) + 7) / 8;
8226.   colsize = ((bps * spp * length) + 7) / 8;
8227.   if ((colsize * width) > (rowsize * length))
            ^
8228.     buffsize = (colsize + 1) * width;
8229.   else

tools/tiffcrop.c:8228:5: 
8226.   colsize = ((bps * spp * length) + 7) / 8;
8227.   if ((colsize * width) > (rowsize * length))
8228.     buffsize = (colsize + 1) * width;
          ^
8229.   else
8230.     buffsize = (rowsize + 1) * length;

tools/tiffcrop.c:8232:3: 
8230.     buffsize = (rowsize + 1) * length;
8231. 
8232.   bytes_per_sample = (bps + 7) / 8;
        ^
8233.   bytes_per_pixel  = ((bps * spp) + 7) / 8;
8234.   if (bytes_per_pixel < (bytes_per_sample + 1))

tools/tiffcrop.c:8233:3: 
8231. 
8232.   bytes_per_sample = (bps + 7) / 8;
8233.   bytes_per_pixel  = ((bps * spp) + 7) / 8;
        ^
8234.   if (bytes_per_pixel < (bytes_per_sample + 1))
8235.     shift_width = bytes_per_pixel;

tools/tiffcrop.c:8234:7: Taking false branch
8232.   bytes_per_sample = (bps + 7) / 8;
8233.   bytes_per_pixel  = ((bps * spp) + 7) / 8;
8234.   if (bytes_per_pixel < (bytes_per_sample + 1))
            ^
8235.     shift_width = bytes_per_pixel;
8236.   else

tools/tiffcrop.c:8237:5: 
8235.     shift_width = bytes_per_pixel;
8236.   else
8237.     shift_width = bytes_per_sample + 1;
          ^
8238. 
8239.   switch (rotation)

tools/tiffcrop.c:8239:3: 
8237.     shift_width = bytes_per_sample + 1;
8238. 
8239.   switch (rotation)
        ^
8240.     {
8241.     case 0:

tools/tiffcrop.c:8241:5: Switch condition is false. Skipping switch case
8239.   switch (rotation)
8240.     {
8241.     case 0:
          ^
8242.     case 360: return (0);
8243.     case 90:

tools/tiffcrop.c:8242:5: Switch condition is false. Skipping switch case
8240.     {
8241.     case 0:
8242.     case 360: return (0);
          ^
8243.     case 90:
8244.     case 180:

tools/tiffcrop.c:8243:5: Switch condition is false. Skipping switch case
8241.     case 0:
8242.     case 360: return (0);
8243.     case 90:
          ^
8244.     case 180:
8245.     case 270: break;

tools/tiffcrop.c:8244:5: Switch condition is true. Entering switch case
8242.     case 360: return (0);
8243.     case 90:
8244.     case 180:
          ^
8245.     case 270: break;
8246.     default:  TIFFError("rotateImage", "Invalid rotation angle %d", rotation);

tools/tiffcrop.c:8250:9: 
8248.     }
8249. 
8250.   if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize)))
              ^
8251.     {
8252.     TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize);

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:8250:9: Taking false branch
8248.     }
8249. 
8250.   if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize)))
              ^
8251.     {
8252.     TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize);

tools/tiffcrop.c:8255:3: 
8253.     return (-1);
8254.     }
8255.   _TIFFmemset(rbuff, '\0', buffsize);
        ^
8256. 
8257.   ibuff = *ibuff_ptr;

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

tools/tiffcrop.c:8257:3: 
8255.   _TIFFmemset(rbuff, '\0', buffsize);
8256. 
8257.   ibuff = *ibuff_ptr;
        ^
8258.   switch (rotation)
8259.     {

tools/tiffcrop.c:8258:3: 
8256. 
8257.   ibuff = *ibuff_ptr;
8258.   switch (rotation)
        ^
8259.     {
8260.     case 180: if ((bps % 8) == 0) /* byte alligned data */

tools/tiffcrop.c:8260:5: Switch condition is false. Skipping switch case
8258.   switch (rotation)
8259.     {
8260.     case 180: if ((bps % 8) == 0) /* byte alligned data */
          ^
8261.                 { 
8262.                 src = ibuff;

tools/tiffcrop.c:8326:5: Switch condition is false. Skipping switch case
8324.               break;
8325. 
8326.     case 90:  if ((bps % 8) == 0) /* byte aligned data */
          ^
8327.                 {
8328.                 for (col = 0; col < width; col++)

tools/tiffcrop.c:8403:5: Switch condition is false. Skipping switch case
8401. 	      break;
8402. 
8403.     case 270: if ((bps % 8) == 0) /* byte aligned data */
          ^
8404.                 {
8405.                 for (col = 0; col < width; col++)

static int
rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
            uint32 *img_length, unsigned char **ibuff_ptr)
  {
  int      shift_width;
  uint32   bytes_per_pixel, bytes_per_sample;
  uint32   row, rowsize, src_offset, dst_offset;
  uint32   i, col, width, length;
  uint32   colsize, buffsize, col_offset, pix_offset;
  unsigned char *ibuff;
  unsigned char *src;
  unsigned char *dst;
  uint16   spp, bps;
  float    res_temp;
  unsigned char *rbuff = NULL;
  width  = *img_width;
  length = *img_length;
  spp = image->spp;
  bps = image->bps;
  rowsize = ((bps * spp * width) + 7) / 8;
  colsize = ((bps * spp * length) + 7) / 8;
  if ((colsize * width) > (rowsize * length))
    buffsize = (colsize + 1) * width;
  else
    buffsize = (rowsize + 1) * length;
  bytes_per_sample = (bps + 7) / 8;
  bytes_per_pixel  = ((bps * spp) + 7) / 8;
  if (bytes_per_pixel < (bytes_per_sample + 1))
    shift_width = bytes_per_pixel;
  else
    shift_width = bytes_per_sample + 1;
  switch (rotation)
    {
    case 0:
    case 360: return (0);
    case 90:
    case 180:
    case 270: break;
    default:  TIFFError("rotateImage", "Invalid rotation angle %d", rotation);
              return (-1);
    }
  if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize)))
    {
    TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize);
    return (-1);
    }
  _TIFFmemset(rbuff, '\0', buffsize);
  ibuff = *ibuff_ptr;
  switch (rotation)
    {
    case 180: if ((bps % 8) == 0)
                {
                src = ibuff;
                pix_offset = (spp * bps) / 8;
                for (row = 0; row < length; row++)
                   {
		   dst_offset = (length - row - 1) * rowsize;
                   for (col = 0; col < width; col++)
                     {
		     col_offset = (width - col - 1) * pix_offset;
                     dst = rbuff + dst_offset + col_offset;
		     for (i = 0; i  < bytes_per_pixel; i++)
		       *dst++ = *src++;
                     }
                   }
                }
	      else
                {
                for (row = 0; row < length; row++)
                  {
		  src_offset = row * rowsize;
		  dst_offset = (length - row - 1) * rowsize;
		  src = ibuff + src_offset;
                  dst = rbuff + dst_offset;
                  switch (shift_width)
                    {
                    case 1: if (bps == 1)
			      {
                              if (reverseSamples8bits(spp, bps, width, src, dst))
                                {
		                _TIFFfree(rbuff);
                                return (-1);
                                }
                              break;
                              }
                            if (reverseSamples16bits(spp, bps, width, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    case 2: if (reverseSamples24bits(spp, bps, width, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    case 3:
                    case 4:
                    case 5: if (reverseSamples32bits(spp, bps, width, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
		             _TIFFfree(rbuff);
                             return (-1);
                    }
		  }
		}
              _TIFFfree(ibuff);
              *(ibuff_ptr) = rbuff;
              break;
    case 90:  if ((bps % 8) == 0)
                {
                for (col = 0; col < width; col++)
                  {
		  src_offset = ((length - 1) * rowsize) + (col * bytes_per_pixel);
                  dst_offset = col * colsize;
		  src = ibuff + src_offset;
		  dst = rbuff + dst_offset;
                  for (row = length; row > 0; row--)
                    {
                    for (i = 0; i < bytes_per_pixel; i++)
                      *dst++ = *(src + i);
		    src -= rowsize;
                    }
		  }
		}
              else
                {
                for (col = 0; col < width; col++)
                  {
		  src_offset = (length - 1) * rowsize;
                  dst_offset = col * colsize;
		  src = ibuff + src_offset;
		  dst = rbuff + dst_offset;
                  switch (shift_width)
                    {
                    case 1: if (bps == 1)
			      {
                              if (rotateContigSamples8bits(rotation, spp, bps, width,
				   	                 length, col, src, dst))
                                {
		                _TIFFfree(rbuff);
                                return (-1);
                                }
                              break;
                              }
                            if (rotateContigSamples16bits(rotation, spp, bps, width,
				   	                 length, col, src, dst))
                              {
	                      _TIFFfree(rbuff);
                              return (-1);
		              }
		            break;
                    case 2: if (rotateContigSamples24bits(rotation, spp, bps, width,
					                  length, col, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    case 3:
                    case 4:
                    case 5: if (rotateContigSamples32bits(rotation, spp, bps, width,
					                  length, col, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
		             _TIFFfree(rbuff);
                             return (-1);
		    }
		  }
		}
              _TIFFfree(ibuff);
              *(ibuff_ptr) = rbuff;
              *img_width = length;
              *img_length = width;
              image->width = length;
              image->length = width;
              res_temp = image->xres;
              image->xres = image->yres;
              image->yres = res_temp;
	      break;
    case 270: if ((bps % 8) == 0)
                {
                for (col = 0; col < width; col++)
                  {
		  src_offset = col * bytes_per_pixel;
                  dst_offset = (width - col - 1) * colsize;
		  src = ibuff + src_offset;
		  dst = rbuff + dst_offset;
                  for (row = length; row > 0; row--)
                    {
                    for (i = 0; i < bytes_per_pixel; i++)
                      *dst++ = *(src + i);
		    src += rowsize;
                    }
		  }
		}
              else
                {
                for (col = 0; col < width; col++)
                  {
		  src_offset = 0;
                  dst_offset = (width - col - 1) * colsize;
		  src = ibuff + src_offset;
		  dst = rbuff + dst_offset;
                  switch (shift_width)
                    {
                    case 1: if (bps == 1)
			      {
                              if (rotateContigSamples8bits(rotation, spp, bps, width,
				   	                 length, col, src, dst))
                                {
		                _TIFFfree(rbuff);
                                return (-1);
                                }
                              break;
                              }
                            if (rotateContigSamples16bits(rotation, spp, bps, width,
				   	                 length, col, src, dst))
                              {
	                      _TIFFfree(rbuff);
                              return (-1);
		              }
		            break;
                    case 2: if (rotateContigSamples24bits(rotation, spp, bps, width,
					                  length, col, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    case 3:
                    case 4:
                    case 5: if (rotateContigSamples32bits(rotation, spp, bps, width,
					                  length, col, src, dst))
                              {
		              _TIFFfree(rbuff);
                              return (-1);
                              }
                             break;
                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
		             _TIFFfree(rbuff);
                             return (-1);
		    }
		  }
		}
              _TIFFfree(ibuff);
              *(ibuff_ptr) = rbuff;
              *img_width = length;
              *img_length = width;
              image->width = length;
              image->length = width;
              res_temp = image->xres;
              image->xres = image->yres;
              image->yres = res_temp;
              break;
    default:
              break;
    }
  return (0);
  }
['static int\nrotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,\n            uint32 *img_length, unsigned char **ibuff_ptr)\n  {\n  int      shift_width;\n  uint32   bytes_per_pixel, bytes_per_sample;\n  uint32   row, rowsize, src_offset, dst_offset;\n  uint32   i, col, width, length;\n  uint32   colsize, buffsize, col_offset, pix_offset;\n  unsigned char *ibuff;\n  unsigned char *src;\n  unsigned char *dst;\n  uint16   spp, bps;\n  float    res_temp;\n  unsigned char *rbuff = NULL;\n  width  = *img_width;\n  length = *img_length;\n  spp = image->spp;\n  bps = image->bps;\n  rowsize = ((bps * spp * width) + 7) / 8;\n  colsize = ((bps * spp * length) + 7) / 8;\n  if ((colsize * width) > (rowsize * length))\n    buffsize = (colsize + 1) * width;\n  else\n    buffsize = (rowsize + 1) * length;\n  bytes_per_sample = (bps + 7) / 8;\n  bytes_per_pixel  = ((bps * spp) + 7) / 8;\n  if (bytes_per_pixel < (bytes_per_sample + 1))\n    shift_width = bytes_per_pixel;\n  else\n    shift_width = bytes_per_sample + 1;\n  switch (rotation)\n    {\n    case 0:\n    case 360: return (0);\n    case 90:\n    case 180:\n    case 270: break;\n    default:  TIFFError("rotateImage", "Invalid rotation angle %d", rotation);\n              return (-1);\n    }\n  if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize)))\n    {\n    TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize);\n    return (-1);\n    }\n  _TIFFmemset(rbuff, \'\\0\', buffsize);\n  ibuff = *ibuff_ptr;\n  switch (rotation)\n    {\n    case 180: if ((bps % 8) == 0)\n                {\n                src = ibuff;\n                pix_offset = (spp * bps) / 8;\n                for (row = 0; row < length; row++)\n                   {\n\t\t   dst_offset = (length - row - 1) * rowsize;\n                   for (col = 0; col < width; col++)\n                     {\n\t\t     col_offset = (width - col - 1) * pix_offset;\n                     dst = rbuff + dst_offset + col_offset;\n\t\t     for (i = 0; i  < bytes_per_pixel; i++)\n\t\t       *dst++ = *src++;\n                     }\n                   }\n                }\n\t      else\n                {\n                for (row = 0; row < length; row++)\n                  {\n\t\t  src_offset = row * rowsize;\n\t\t  dst_offset = (length - row - 1) * rowsize;\n\t\t  src = ibuff + src_offset;\n                  dst = rbuff + dst_offset;\n                  switch (shift_width)\n                    {\n                    case 1: if (bps == 1)\n\t\t\t      {\n                              if (reverseSamples8bits(spp, bps, width, src, dst))\n                                {\n\t\t                _TIFFfree(rbuff);\n                                return (-1);\n                                }\n                              break;\n                              }\n                            if (reverseSamples16bits(spp, bps, width, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    case 2: if (reverseSamples24bits(spp, bps, width, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    case 3:\n                    case 4:\n                    case 5: if (reverseSamples32bits(spp, bps, width, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);\n\t\t             _TIFFfree(rbuff);\n                             return (-1);\n                    }\n\t\t  }\n\t\t}\n              _TIFFfree(ibuff);\n              *(ibuff_ptr) = rbuff;\n              break;\n    case 90:  if ((bps % 8) == 0)\n                {\n                for (col = 0; col < width; col++)\n                  {\n\t\t  src_offset = ((length - 1) * rowsize) + (col * bytes_per_pixel);\n                  dst_offset = col * colsize;\n\t\t  src = ibuff + src_offset;\n\t\t  dst = rbuff + dst_offset;\n                  for (row = length; row > 0; row--)\n                    {\n                    for (i = 0; i < bytes_per_pixel; i++)\n                      *dst++ = *(src + i);\n\t\t    src -= rowsize;\n                    }\n\t\t  }\n\t\t}\n              else\n                {\n                for (col = 0; col < width; col++)\n                  {\n\t\t  src_offset = (length - 1) * rowsize;\n                  dst_offset = col * colsize;\n\t\t  src = ibuff + src_offset;\n\t\t  dst = rbuff + dst_offset;\n                  switch (shift_width)\n                    {\n                    case 1: if (bps == 1)\n\t\t\t      {\n                              if (rotateContigSamples8bits(rotation, spp, bps, width,\n\t\t\t\t   \t                 length, col, src, dst))\n                                {\n\t\t                _TIFFfree(rbuff);\n                                return (-1);\n                                }\n                              break;\n                              }\n                            if (rotateContigSamples16bits(rotation, spp, bps, width,\n\t\t\t\t   \t                 length, col, src, dst))\n                              {\n\t                      _TIFFfree(rbuff);\n                              return (-1);\n\t\t              }\n\t\t            break;\n                    case 2: if (rotateContigSamples24bits(rotation, spp, bps, width,\n\t\t\t\t\t                  length, col, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    case 3:\n                    case 4:\n                    case 5: if (rotateContigSamples32bits(rotation, spp, bps, width,\n\t\t\t\t\t                  length, col, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);\n\t\t             _TIFFfree(rbuff);\n                             return (-1);\n\t\t    }\n\t\t  }\n\t\t}\n              _TIFFfree(ibuff);\n              *(ibuff_ptr) = rbuff;\n              *img_width = length;\n              *img_length = width;\n              image->width = length;\n              image->length = width;\n              res_temp = image->xres;\n              image->xres = image->yres;\n              image->yres = res_temp;\n\t      break;\n    case 270: if ((bps % 8) == 0)\n                {\n                for (col = 0; col < width; col++)\n                  {\n\t\t  src_offset = col * bytes_per_pixel;\n                  dst_offset = (width - col - 1) * colsize;\n\t\t  src = ibuff + src_offset;\n\t\t  dst = rbuff + dst_offset;\n                  for (row = length; row > 0; row--)\n                    {\n                    for (i = 0; i < bytes_per_pixel; i++)\n                      *dst++ = *(src + i);\n\t\t    src += rowsize;\n                    }\n\t\t  }\n\t\t}\n              else\n                {\n                for (col = 0; col < width; col++)\n                  {\n\t\t  src_offset = 0;\n                  dst_offset = (width - col - 1) * colsize;\n\t\t  src = ibuff + src_offset;\n\t\t  dst = rbuff + dst_offset;\n                  switch (shift_width)\n                    {\n                    case 1: if (bps == 1)\n\t\t\t      {\n                              if (rotateContigSamples8bits(rotation, spp, bps, width,\n\t\t\t\t   \t                 length, col, src, dst))\n                                {\n\t\t                _TIFFfree(rbuff);\n                                return (-1);\n                                }\n                              break;\n                              }\n                            if (rotateContigSamples16bits(rotation, spp, bps, width,\n\t\t\t\t   \t                 length, col, src, dst))\n                              {\n\t                      _TIFFfree(rbuff);\n                              return (-1);\n\t\t              }\n\t\t            break;\n                    case 2: if (rotateContigSamples24bits(rotation, spp, bps, width,\n\t\t\t\t\t                  length, col, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    case 3:\n                    case 4:\n                    case 5: if (rotateContigSamples32bits(rotation, spp, bps, width,\n\t\t\t\t\t                  length, col, src, dst))\n                              {\n\t\t              _TIFFfree(rbuff);\n                              return (-1);\n                              }\n                             break;\n                    default: TIFFError("rotateImage","Unsupported bit depth %d", bps);\n\t\t             _TIFFfree(rbuff);\n                             return (-1);\n\t\t    }\n\t\t  }\n\t\t}\n              _TIFFfree(ibuff);\n              *(ibuff_ptr) = rbuff;\n              *img_width = length;\n              *img_length = width;\n              image->width = length;\n              image->length = width;\n              res_temp = image->xres;\n              image->xres = image->yres;\n              image->yres = res_temp;\n              break;\n    default:\n              break;\n    }\n  return (0);\n  }', 'void*\n_TIFFmalloc(tmsize_t s)\n{\n        if (s == 0)\n                return ((void *) NULL);\n\treturn (malloc((size_t) s));\n}', 'void\n_TIFFmemset(void* p, int v, tmsize_t c)\n{\n\tmemset(p, v, (size_t) c);\n}']