From 8703d93bbf421b76f289f1e4f6c0489245071604 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Mon, 23 Feb 2015 17:24:52 +0000 Subject: [PATCH] decodebin: move null check Check if dbin->decode_chain is NULL before running drain_and_switch_chains() because if it is, we shouldn't run that function or it will segfault. CID #1271074 --- gst/playback/gstdecodebin2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 5544ee0032..c4fa8572d1 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3903,12 +3903,12 @@ gst_decode_pad_handle_eos (GstDecodePad * pad) GST_LOG_OBJECT (dbin, "pad %p", pad); EXPOSE_LOCK (dbin); - drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained, - &switched); + if (dbin->decode_chain) { + drain_and_switch_chains (dbin->decode_chain, pad, &last_group, &drained, + &switched); - if (switched) { - /* If we resulted in a group switch, expose what's needed */ - if (dbin->decode_chain) { + if (switched) { + /* If we resulted in a group switch, expose what's needed */ if (gst_decode_chain_is_complete (dbin->decode_chain)) gst_decode_bin_expose (dbin); }