libtiff/tif_jpeg.c:892: error: Integer Overflow L2
  ([1, `data->filebytesleft`] - [0, 2147483647]):unsigned64 by call to `JPEGFixupTagsSubsamplingReadByte`.

libtiff/tif_jpeg.c:885:1: Parameter `data->filebytesleft`
883. }
884. 
885. static int
     ^
886. JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result)
887. {

libtiff/tif_jpeg.c:890:7: Call
888. 	uint8 ma;
889. 	uint8 mb;
890. 	if (!JPEGFixupTagsSubsamplingReadByte(data,&ma))
           ^
891. 		return(0);
892. 	if (!JPEGFixupTagsSubsamplingReadByte(data,&mb))

libtiff/tif_jpeg.c:855:1: Parameter `data->filebytesleft`
  853. }
  854. 
  855. static int
       ^
  856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
  857. {

libtiff/tif_jpeg.c:892:7: Call
890. 	if (!JPEGFixupTagsSubsamplingReadByte(data,&ma))
891. 		return(0);
892. 	if (!JPEGFixupTagsSubsamplingReadByte(data,&mb))
           ^
893. 		return(0);
894. 	*result=(ma<<8)|mb;

libtiff/tif_jpeg.c:855:1: <LHS trace>
853. }
854. 
855. static int
     ^
856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
857. {

libtiff/tif_jpeg.c:855:1: Parameter `data->filebytesleft`
  853. }
  854. 
  855. static int
       ^
  856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
  857. {

libtiff/tif_jpeg.c:872:7: <RHS trace>
870. 			m=(uint32)data->filebytesleft;
871. 		assert(m<0x80000000UL);
872. 		if (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m)
           ^
873. 			return(0);
874. 		data->buffercurrentbyte=data->buffer;

libtiff/tif_jpeg.c:872:7: Unknown value from: non-const function
  870. 			m=(uint32)data->filebytesleft;
  871. 		assert(m<0x80000000UL);
  872. 		if (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m)
             ^
  873. 			return(0);
  874. 		data->buffercurrentbyte=data->buffer;

libtiff/tif_jpeg.c:877:3: Binary operation: ([1, data->filebytesleft] - [0, 2147483647]):unsigned64 by call to `JPEGFixupTagsSubsamplingReadByte` 
  875. 		data->bufferbytesleft=m;
  876. 		data->fileoffset+=m;
  877. 		data->filebytesleft-=m;
         ^
  878. 	}
  879. 	*result=*data->buffercurrentbyte;

static int
JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
{
	if (data->bufferbytesleft==0)
	{
		uint32 m;
		if (data->filebytesleft==0)
			return(0);
		if (!data->filepositioned)
		{
			TIFFSeekFile(data->tif,data->fileoffset,SEEK_SET);
			data->filepositioned=1;
		}
		m=data->buffersize;
		if ((uint64)m>data->filebytesleft)
			m=(uint32)data->filebytesleft;
		assert(m<0x80000000UL);
		if (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m)
			return(0);
		data->buffercurrentbyte=data->buffer;
		data->bufferbytesleft=m;
		data->fileoffset+=m;
		data->filebytesleft-=m;
	}
	*result=*data->buffercurrentbyte;
	data->buffercurrentbyte++;
	data->bufferbytesleft--;
	return(1);
}
['static int\nJPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result)\n{\n\tuint8 ma;\n\tuint8 mb;\n\tif (!JPEGFixupTagsSubsamplingReadByte(data,&ma))\n\t\treturn(0);\n\tif (!JPEGFixupTagsSubsamplingReadByte(data,&mb))\n\t\treturn(0);\n\t*result=(ma<<8)|mb;\n\treturn(1);\n}', 'static int\nJPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)\n{\n\tif (data->bufferbytesleft==0)\n\t{\n\t\tuint32 m;\n\t\tif (data->filebytesleft==0)\n\t\t\treturn(0);\n\t\tif (!data->filepositioned)\n\t\t{\n\t\t\tTIFFSeekFile(data->tif,data->fileoffset,SEEK_SET);\n\t\t\tdata->filepositioned=1;\n\t\t}\n\t\tm=data->buffersize;\n\t\tif ((uint64)m>data->filebytesleft)\n\t\t\tm=(uint32)data->filebytesleft;\n\t\tassert(m<0x80000000UL);\n\t\tif (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m)\n\t\t\treturn(0);\n\t\tdata->buffercurrentbyte=data->buffer;\n\t\tdata->bufferbytesleft=m;\n\t\tdata->fileoffset+=m;\n\t\tdata->filebytesleft-=m;\n\t}\n\t*result=*data->buffercurrentbyte;\n\tdata->buffercurrentbyte++;\n\tdata->bufferbytesleft--;\n\treturn(1);\n}']