1
From 0782c759084daaf9e4de7ee6be7543081823455e Mon Sep 17 00:00:00 2001
2
From: erouault <erouault>
3
Date: Sun, 21 Dec 2014 20:58:29 +0000
4
Subject: [PATCH] * tools/tiff2bw.c: when Photometric=RGB, the utility only
5
works if SamplesPerPixel = 3. Enforce that
6
http://bugzilla.maptools.org/show_bug.cgi?id=2485 (CVE-2014-8127)
10
tools/tiff2bw.c | 5 +++++
11
2 files changed, 11 insertions(+)
13
Index: tiff-3.9.5/tools/tiff2bw.c
14
===================================================================
15
--- tiff-3.9.5.orig/tools/tiff2bw.c 2015-03-30 07:47:25.321241804 -0400
16
+++ tiff-3.9.5/tools/tiff2bw.c 2015-03-30 07:47:25.317241770 -0400
18
argv[optind], samplesperpixel);
21
+ if( photometric == PHOTOMETRIC_RGB && samplesperpixel != 3) {
22
+ fprintf(stderr, "%s: Bad samples/pixel %u for PHOTOMETRIC_RGB.\n",
23
+ argv[optind], samplesperpixel);
26
TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
27
if (bitspersample != 8) {