summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-17 15:48:20 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-17 17:08:45 +0100
commit68c4019057b5f9090622c9d5eb3f6b4cb947c2a0 (patch)
treecd8e505b7e40e7aa29667a5a513a73d60e8f0bd8 /ext
parent4ce46c932b64c2458855cfe7fea23714cc648e87 (diff)
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/jpeg/smokecodec.c5
1 files changed, 5 insertions, 0 deletions
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;