noddos: Noddos v0.5.0 with mDNS / DNS-SD support
[feed/packages.git] / libs / tiff / patches / 120-CVE-2017-7601.patch
1 From 0a76a8c765c7b8327c59646284fa78c3c27e5490 Mon Sep 17 00:00:00 2001
2 From: erouault <erouault>
3 Date: Wed, 11 Jan 2017 16:13:50 +0000
4 Subject: [PATCH] * libtiff/tif_jpeg.c: validate BitsPerSample in
5 JPEGSetupEncode() to avoid undefined behaviour caused by invalid shift
6 exponent. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
7
8 ---
9 ChangeLog | 6 ++++++
10 libtiff/tif_jpeg.c | 7 +++++++
11 2 files changed, 13 insertions(+)
12
13 diff --git a/ChangeLog b/ChangeLog
14 index 6517640..8e202a2 100644
15 --- a/ChangeLog
16 +++ b/ChangeLog
17 @@ -1,5 +1,11 @@
18 2017-01-11 Even Rouault <even.rouault at spatialys.com>
19
20 + * libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
21 + undefined behaviour caused by invalid shift exponent.
22 + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
23 +
24 +2017-01-11 Even Rouault <even.rouault at spatialys.com>
25 +
26 * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
27 of double to other data types to avoid undefined behaviour if the output range
28 isn't big enough to hold the input value.
29 diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
30 index 6c17c38..192989a 100644
31 --- a/libtiff/tif_jpeg.c
32 +++ b/libtiff/tif_jpeg.c
33 @@ -1632,6 +1632,13 @@ JPEGSetupEncode(TIFF* tif)
34 "Invalig horizontal/vertical sampling value");
35 return (0);
36 }
37 + if( td->td_bitspersample > 16 )
38 + {
39 + TIFFErrorExt(tif->tif_clientdata, module,
40 + "BitsPerSample %d not allowed for JPEG",
41 + td->td_bitspersample);
42 + return (0);
43 + }
44
45 /*
46 * A ReferenceBlackWhite field *must* be present since the