head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.4 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.2 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.1.0.8 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.6 pkgsrc-2011Q3-base:1.1 pkgsrc-2011Q2:1.1.0.4 pkgsrc-2011Q2-base:1.1 pkgsrc-2011Q1:1.1.0.2 pkgsrc-2011Q1-base:1.1; locks; strict; comment @# @; 1.2 date 2012.03.07.16.17.05; author adam; state dead; branches; next 1.1; 1.1 date 2011.03.31.11.08.29; author drochner; state Exp; branches; next ; desc @@ 1.2 log @Changes 1.9.0: * New GDAL drivers: ACE2, CTG, E00GRID, ECRGTOC, GRASSASCIIGrid, GTA, NGSGEOID, SNODAS, WebP, ZMap * New OGR drivers: ARCGEN, CouchDB, DWG, EDIGEO, FileGDB, Geomedia, GFT, IDRISI, MDB, SEGUKOOA, SEGY, SVG, XLS * Significantly improved drivers: NetCDF * Encoding support for shapefile/dbf * RFC 35: Delete, reorder and alter field definitions of OGR layers * RFC 37: Add mechanism to provide user data to CPLErrorHandler * gdalsrsinfo: new supported utility to report SRS in various form (supercedes testepsg) @ text @$NetBSD: patch-CVE-2011-1167,v 1.1 2011/03/31 11:08:29 drochner Exp $ --- frmts/gtiff/libtiff/tif_thunder.c.orig 2011-01-14 05:19:04.000000000 +0000 +++ frmts/gtiff/libtiff/tif_thunder.c @@@@ -25,6 +25,7 @@@@ */ #include "tiffiop.h" +#include #ifdef THUNDER_SUPPORT /* * TIFF Library. @@@@ -55,15 +56,35 @@@@ static const int twobitdeltas[4] = { 0, 1, 0, -1 }; static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 }; -#define SETPIXEL(op, v) { \ - lastpixel = (v) & 0xf; \ - if (npixels++ & 1) \ - *op++ |= lastpixel; \ - else \ - op[0] = (uint8) (lastpixel << 4); \ +#define SETPIXEL(op, v) { \ + lastpixel = (v) & 0xf; \ + if ( npixels < maxpixels ) \ + { \ + if (npixels++ & 1) \ + *op++ |= lastpixel; \ + else \ + op[0] = (uint8) (lastpixel << 4); \ + } \ } static int +ThunderSetupDecode(TIFF* tif) +{ + static const char module[] = "ThunderSetupDecode"; + + if( tif->tif_dir.td_bitspersample != 4 ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Wrong bitspersample value (%d), Thunder decoder only supports 4bits per sample.", + (int) tif->tif_dir.td_bitspersample ); + return 0; + } + + + return (1); + } + +static int ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels) { static const char module[] = "ThunderDecode"; @@@@ -160,7 +181,8 @@@@ ThunderDecodeRow(TIFF* tif, uint8* buf, occ -= tif->tif_scanlinesize; row += tif->tif_scanlinesize; } - return (1); + + return (1); } int @@@@ -169,6 +191,7 @@@@ TIFFInitThunderScan(TIFF* tif, int schem (void) scheme; tif->tif_decoderow = ThunderDecodeRow; tif->tif_decodestrip = ThunderDecodeRow; + tif->tif_setupdecode = ThunderSetupDecode; return (1); } #endif /* THUNDER_SUPPORT */ @ 1.1 log @copy patch from graphics/tiff for CVE-2011-1167 (don't know whether this code is used here, but anyway), ride on last night's revbump @ text @d1 1 a1 1 $NetBSD$ @