diff options
author | erouault <erouault> | 2017-01-11 16:38:26 +0000 |
---|---|---|
committer | erouault <erouault> | 2017-01-11 16:38:26 +0000 |
commit | 9bcf81340db194a272c8b426121aaf770627c4cf (patch) | |
tree | 6d30cd69a8caae8ebda1902646a623d8efbf28f1 | |
parent | ad7a973cce73e457f6b8bad8ee81ce076450e738 (diff) | |
download | libtiff-9bcf81340db194a272c8b426121aaf770627c4cf.tar.gz |
* libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
avoid UndefinedBehaviorSanitizer warning.
Patch by Nicolás Peña.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libtiff/tif_getimage.c | 4 |
2 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,12 @@ 2017-01-11 Even Rouault <even.rouault at spatialys.com> + * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to + avoid UndefinedBehaviorSanitizer warning. + Patch by Nicolás Peña. + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658 + +2017-01-11 Even Rouault <even.rouault at spatialys.com> + * libtiff/tif_read.c: avoid potential undefined behaviour on signed integer addition in TIFFReadRawStrip1() in isMapped() case. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2650 diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c index 2ea83855..52a2402f 100644 --- a/libtiff/tif_getimage.c +++ b/libtiff/tif_getimage.c @@ -1,4 +1,4 @@ -/* $Id: tif_getimage.c,v 1.101 2016-12-18 22:28:42 erouault Exp $ */ +/* $Id: tif_getimage.c,v 1.102 2017-01-11 16:38:26 erouault Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -1302,7 +1302,7 @@ DECLAREContigPutFunc(putagreytile) while (h-- > 0) { for (x = w; x-- > 0;) { - *cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1); + *cp++ = BWmap[*pp][0] & ((uint32)*(pp+1) << 24 | ~A1); pp += samplesperpixel; } cp += toskew; |