mpegtsmux: fix segfault if gst_collect_pads_pop () returns no buffer

In mpegtsmux_choose_best_stream () call if the gst_collect_pads_pop () call
returns no buffer (NULL), the plugin SegFaults in the gst_buffer_unref call.
To fix this we check if a valid buffer is returned before calling
gst_buffer_unref ().

Fixes bug #654416.
This commit is contained in:
Sameer Naik 2011-07-12 01:18:16 +05:30 committed by Sebastian Dröge
parent 83c4e8814e
commit 666807ed69

View file

@ -642,7 +642,9 @@ mpegtsmux_choose_best_stream (MpegTsMux * mux)
}
}
if (c_best) {
gst_buffer_unref (gst_collect_pads_pop (mux->collect, c_best));
GstBuffer *buffer;
if ((buffer = gst_collect_pads_pop (mux->collect, c_best)))
gst_buffer_unref (buffer);
}
return best;