diff options
author | faxguy <faxguy> | 2015-06-15 16:13:46 +0000 |
---|---|---|
committer | faxguy <faxguy> | 2015-06-15 16:13:46 +0000 |
commit | dfe7bbe5663ce088f2e8a88582699480b66b81fb (patch) | |
tree | f7d9413d586c18a20bd40de50cc7c0401098fa8c | |
parent | 01ee8c13c0c81b96aca02ce5178d3e65c1cfb2e8 (diff) | |
download | libtiff-dfe7bbe5663ce088f2e8a88582699480b66b81fb.tar.gz |
Attempt to fix Coverity warning:
CID 1306634: Integer handling issues (SIGN_EXTENSION)
Suspicious implicit sign extension: "img->samplesperpixel" with type
"unsigned short" (16 bits, unsigned) is promoted in
"img->col_offset * img->samplesperpixel" to type "int" (32 bits, signed),
then sign-extended to type "long" (64 bits, signed). If
"img->col_offset * img->samplesperpixel" is greater than 0x7FFFFFFF, the
upper bits of the result will all be 1.
-rw-r--r-- | libtiff/tif_getimage.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c index 77b2fab8..1095c25e 100644 --- a/libtiff/tif_getimage.c +++ b/libtiff/tif_getimage.c @@ -1,4 +1,4 @@ -/* $Id: tif_getimage.c,v 1.88 2015-06-14 22:14:10 faxguy Exp $ */ +/* $Id: tif_getimage.c,v 1.89 2015-06-15 16:13:46 faxguy Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -660,7 +660,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) break; } pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif) + \ - (fromskew * img->samplesperpixel); + ((int32) fromskew * img->samplesperpixel); if (tocol + this_tw > w) { /* @@ -827,7 +827,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif) + \ - (fromskew * img->samplesperpixel); + ((int32) fromskew * img->samplesperpixel); if (tocol + this_tw > w) { /* @@ -937,7 +937,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ - (img->col_offset * img->samplesperpixel); + ((int32) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); } @@ -1069,7 +1069,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } pos = ((row + img->row_offset) % rowsperstrip) * scanline + \ - (img->col_offset * img->samplesperpixel); + ((int32) img->col_offset * img->samplesperpixel); (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); |