From 05a3dfef44e2b2072ba31bc0324a3f2f8e5569ca Mon Sep 17 00:00:00 2001 From: Bob Friesenhahn Date: Thu, 3 Sep 2009 20:45:22 +0000 Subject: [PATCH] * libtiff/tif_ojpeg.c (OJPEGWriteHeaderInfo): IJG JPEG 7 needs do_fancy_upsampling=FALSE in order to read raw data. Resolves "Bug 2090 - OJPEG crash with libjpeg v7". http://bugzilla.maptools.org/show_bug.cgi?id=2090 --- ChangeLog | 7 +++++++ libtiff/tif_ojpeg.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 76adb258..9f7ad706 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-03 Bob Friesenhahn + + * libtiff/tif_ojpeg.c (OJPEGWriteHeaderInfo): IJG JPEG 7 needs + do_fancy_upsampling=FALSE in order to read raw data. Resolves + "Bug 2090 - OJPEG crash with libjpeg v7". + http://bugzilla.maptools.org/show_bug.cgi?id=2090 + 2009-09-03 Frank Warmerdam * libtiff/tif_getimage.c: Fixed error recognition handling in RGBA diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c index 2694d67d..c7841d66 100644 --- a/libtiff/tif_ojpeg.c +++ b/libtiff/tif_ojpeg.c @@ -1,4 +1,4 @@ -/* $Id: tif_ojpeg.c,v 1.45 2009-05-03 14:29:36 fwarmerdam Exp $ */ +/* $Id: tif_ojpeg.c,v 1.46 2009-09-03 20:45:22 bfriesen Exp $ */ /* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0 specification is now totally obsolete and deprecated for new applications and @@ -1155,6 +1155,9 @@ OJPEGWriteHeaderInfo(TIFF* tif) if ((sp->subsampling_force_desubsampling_inside_decompression==0) && (sp->samples_per_pixel_per_plane>1)) { sp->libjpeg_jpeg_decompress_struct.raw_data_out=1; +#if JPEG_LIB_VERSION >= 70 + sp->libjpeg_jpeg_decompress_struct.do_fancy_upsampling=FALSE; +#endif sp->libjpeg_jpeg_query_style=0; if (sp->subsampling_convert_log==0) {