From e7fb8eb3e9f220a5f0c852f0238ab8d536a8bc9d Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 11 Jan 2017 17:18:01 -0500 Subject: Prevent undefined shift in putagreytile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch has been accepted upstream, see: http://bugzilla.maptools.org/show_bug.cgi?id=2658 BUG=655008 Change-Id: I7ef69e6f71e66bd7e0a4d334c4f8e60ed02213d2 Reviewed-on: https://pdfium-review.googlesource.com/2174 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- .../libtiff/0014-cast-to-unsigned-in-putagreytile.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 third_party/libtiff/0014-cast-to-unsigned-in-putagreytile.patch (limited to 'third_party/libtiff/0014-cast-to-unsigned-in-putagreytile.patch') diff --git a/third_party/libtiff/0014-cast-to-unsigned-in-putagreytile.patch b/third_party/libtiff/0014-cast-to-unsigned-in-putagreytile.patch new file mode 100644 index 0000000000..00336b188c --- /dev/null +++ b/third_party/libtiff/0014-cast-to-unsigned-in-putagreytile.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/libtiff/tif_getimage.c b/third_party/libtiff/tif_getimage.c +index 1cf6ac6b4..2861cdd1e 100644 +--- a/third_party/libtiff/tif_getimage.c ++++ b/third_party/libtiff/tif_getimage.c +@@ -1281,7 +1281,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; -- cgit v1.2.3