From: Hans Verkuil Date: Tue, 3 Jun 2014 09:04:16 +0000 (+0200) Subject: qv4l2: fix segmentation fault when compiled without ALSA support. X-Git-Tag: v4l-utils-1.2.0~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=341f2f04a552b3b436a957e95d8af250c2cd1afb;p=platform%2Fupstream%2Fv4l-utils.git qv4l2: fix segmentation fault when compiled without ALSA support. If opening the video device fails, then qv4l2 attempts to disable two alsa widgets. If qv4l2 was compiled without alsa support, then those widget pointers are NULL and you get a segfault. Add the proper #ifdef so this is only done if alsa support was compiled in. Signed-off-by: Hans Verkuil --- diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp index bcce927..5f26ff4 100644 --- a/utils/qv4l2/qv4l2.cpp +++ b/utils/qv4l2/qv4l2.cpp @@ -208,8 +208,10 @@ void ApplicationWindow::setDevice(const QString &device, bool rawOpen) connect(m_sigMapper, SIGNAL(mapped(int)), this, SLOT(ctrlAction(int))); if (!open(device, !rawOpen)) { +#ifdef HAVE_ALSA m_showAllAudioAct->setEnabled(false); m_audioBufferAct->setEnabled(false); +#endif return; }