Skip to contentSkip to conversation

Bug in xawtv with libjpeg v8

PATCH Markus Königshaus 1 participant 1 message Oct 7, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Using streamer from xawtv-3.102 segfaults with jpeg-output and libjpeg v8. Attached patch will resolve the problem.

Regards, Markus

-- Unsere Aussagen koennen Irrtuemer und Missverstaendnisse enthalten.
Bitte pruefen Sie die Aussagen fuer Ihren Fall, bevor Sie Entscheidungen auf Grundlage dieser Aussagen treffen. Wiesemann & Theis GmbH, Porschestr. 12, D-42279 Wuppertal
Geschaeftsfuehrer: Dipl.-Ing. Ruediger Theis
Registergericht: Amtsgericht Wuppertal, HRB 6377 Tel. +49-202/2680-0, Fax +49-202/2680-265, http://www.wut.de

from https://bugs.gentoo.org/show_bug.cgi?id=294488
[...]
explicitly set do_fancy_downsampling to FALSE

Apparently, when settings dinfo.raw_data_in,
previous version jpeg automatically set dinfo.do_fancy_downsampling to FALSE. Newer versions (since 7) of media-libs/jpeg do not do that anymore and the program must do it explicitly (although I have not found any documentation to that effect).

Compile tested only, but a similar fix in mjpegtools (but output rather than input) works.

libng/plugins/conv-mjpeg.c +1 -0
@@ -229,6 +229,7 @@
     jpeg_set_quality(&h->mjpg_cinfo, ng_jpeg_quality, TRUE);
 
     h->mjpg_cinfo.raw_data_in = TRUE;
+    h->mjpg_cinfo.do_fancy_downsampling = FALSE;  // fix segfaulst with libjpeg v7++
     jpeg_set_colorspace(&h->mjpg_cinfo,JCS_YCbCr);
 
     h->mjpg_ptrs[0] = malloc(h->fmt.height*sizeof(char*));