3
From feed76c99f132f02a938de3b566442bff61388ef Mon Sep 17 00:00:00 2001
4
From: erouault <erouault>
5
Date: Mon, 29 Dec 2014 18:28:46 +0000
6
Subject: [PATCH] * libtiff/tif_getimage.c: move test on vertical value of
7
YCbCr subsampling. to avoid buffer leak (fix previous fix, found by Coverity
12
libtiff/tif_getimage.c | 12 +++++++-----
13
2 files changed, 10 insertions(+), 7 deletions(-)
15
Index: tiff-3.9.5/libtiff/tif_getimage.c
16
===================================================================
17
--- tiff-3.9.5.orig/libtiff/tif_getimage.c 2015-03-30 08:01:27.936586534 -0400
18
+++ tiff-3.9.5/libtiff/tif_getimage.c 2015-03-30 08:02:04.644905539 -0400
20
int32 fromskew, toskew;
23
+ TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
24
+ if( subsamplingver == 0 ) {
25
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling");
29
buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
31
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
35
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
36
- TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
37
- if( subsamplingver == 0 ) {
38
- TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling");
42
scanline = TIFFNewScanlineSize(tif);
43
fromskew = (w < imagewidth ? imagewidth - w : 0);
44
for (row = 0; row < h; row += nrow)