From 68c4019057b5f9090622c9d5eb3f6b4cb947c2a0 Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Mon, 17 Aug 2009 15:48:20 +0100 Subject: smokeenc: don't crash when compiled against libjpeg7 Set parameters so that we don't crash with libjpeg7. Based on Stefan Kost's fix for jpegenc. Fixes #591951. --- ext/jpeg/smokecodec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext') diff --git a/ext/jpeg/smokecodec.c b/ext/jpeg/smokecodec.c index 02246b74..98adf608 100644 --- a/ext/jpeg/smokecodec.c +++ b/ext/jpeg/smokecodec.c @@ -145,6 +145,11 @@ smokecodec_encode_new (SmokeCodecInfo ** info, newinfo->cinfo.dct_method = JDCT_FASTEST; + /* prepare for raw input */ +#if JPEG_LIB_VERSION >= 70 + newinfo->cinfo.do_fancy_downsampling = FALSE; +#endif + newinfo->cinfo.raw_data_in = TRUE; newinfo->cinfo.in_color_space = JCS_YCbCr; newinfo->cinfo.comp_info[0].h_samp_factor = 2; -- cgit