tif_thunder: avoid unsigned integer overflow (not a bug). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16632
This commit is contained in:
parent
f277541bd8
commit
c9edebfdb0
@ -122,17 +122,17 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
|
||||
break;
|
||||
case THUNDER_2BITDELTAS: /* 2-bit deltas */
|
||||
if ((delta = ((n >> 4) & 3)) != DELTA2_SKIP)
|
||||
SETPIXEL(op, lastpixel + twobitdeltas[delta]);
|
||||
SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
|
||||
if ((delta = ((n >> 2) & 3)) != DELTA2_SKIP)
|
||||
SETPIXEL(op, lastpixel + twobitdeltas[delta]);
|
||||
SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
|
||||
if ((delta = (n & 3)) != DELTA2_SKIP)
|
||||
SETPIXEL(op, lastpixel + twobitdeltas[delta]);
|
||||
SETPIXEL(op, (unsigned)((int)lastpixel + twobitdeltas[delta]));
|
||||
break;
|
||||
case THUNDER_3BITDELTAS: /* 3-bit deltas */
|
||||
if ((delta = ((n >> 3) & 7)) != DELTA3_SKIP)
|
||||
SETPIXEL(op, lastpixel + threebitdeltas[delta]);
|
||||
SETPIXEL(op, (unsigned)((int)lastpixel + threebitdeltas[delta]));
|
||||
if ((delta = (n & 7)) != DELTA3_SKIP)
|
||||
SETPIXEL(op, lastpixel + threebitdeltas[delta]);
|
||||
SETPIXEL(op, (unsigned)((int)lastpixel + threebitdeltas[delta]));
|
||||
break;
|
||||
case THUNDER_RAW: /* raw data */
|
||||
SETPIXEL(op, n);
|
||||
|
Loading…
Reference in New Issue
Block a user