diff options
author | Even Rouault <even.rouault@spatialys.com> | 2019-10-23 13:20:38 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2019-10-23 13:20:38 +0000 |
commit | dc3eab1cdfb685d3fdfdb896507c0772af4b9e6f (patch) | |
tree | 2c0067a46ad12d8ead04299adff7f80bbe40cbf8 | |
parent | 43b0c984f0a2c81565b05b6590bf9de7df612477 (diff) | |
parent | 2105b483837a3179f830ce14d92950bd6aa35594 (diff) | |
download | libtiff-git-dc3eab1cdfb685d3fdfdb896507c0772af4b9e6f.tar.gz |
Merge branch 'coverity-fixes' into 'master'
Coverity fixes
See merge request libtiff/libtiff!94
-rw-r--r-- | libtiff/tif_jpeg.c | 4 | ||||
-rw-r--r-- | libtiff/tif_pixarlog.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c index 8606f623..ea2fb59c 100644 --- a/libtiff/tif_jpeg.c +++ b/libtiff/tif_jpeg.c @@ -1563,7 +1563,7 @@ JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) JSAMPLE *outptr = (JSAMPLE*)tmpbuf + clumpoffset; #else JSAMPLE *outptr = (JSAMPLE*)buf + clumpoffset; - if (cc < (tmsize_t) (clumpoffset + samples_per_clump*(clumps_per_line-1) + hsamp)) { + if (cc < (clumpoffset + (tmsize_t)samples_per_clump*(clumps_per_line-1) + hsamp)) { TIFFErrorExt(tif->tif_clientdata, "JPEGDecodeRaw", "application buffer not large enough for all data, possible subsampling issue"); return 0; @@ -2123,7 +2123,7 @@ JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) /* data is expected to be supplied in multiples of a clumpline */ /* a clumpline is equivalent to v_sampling desubsampled scanlines */ /* TODO: the following calculation of bytesperclumpline, should substitute calculation of sp->bytesperline, except that it is per v_sampling lines */ - bytesperclumpline = (((sp->cinfo.c.image_width+sp->h_sampling-1)/sp->h_sampling) + bytesperclumpline = ((((tmsize_t)sp->cinfo.c.image_width+sp->h_sampling-1)/sp->h_sampling) *(sp->h_sampling*sp->v_sampling+2)*sp->cinfo.c.data_precision+7) /8; diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c index a2149c85..62640905 100644 --- a/libtiff/tif_pixarlog.c +++ b/libtiff/tif_pixarlog.c @@ -1147,7 +1147,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) llen = sp->stride * td->td_imagewidth; /* Check against the number of elements (of size uint16) of sp->tbuf */ - if( n > (tmsize_t)(td->td_rowsperstrip * llen) ) + if( n > ((tmsize_t)td->td_rowsperstrip * llen) ) { TIFFErrorExt(tif->tif_clientdata, module, "Too many input bytes provided"); |