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
This commit is contained in:
Luis de Bethencourt 2015-02-23 17:24:52 +00:00
parent b3053925ac
commit 8703d93bbf

View file

@ -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);
}