mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-03 15:06:34 +00:00
matroska-mux: Fix sparse stream crash
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/656 introduced an invalid memory access when debug is enabled, by casting the wrong pointer to a GstCollectPad. Fixing that showed the original change was incorrect and leads to an infinite loop in the testsuite. This patch fixes both problems. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/788>
This commit is contained in:
parent
e0b708ea4a
commit
0e84f42055
1 changed files with 3 additions and 4 deletions
|
@ -2255,8 +2255,6 @@ refuse_caps:
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstCollectData *data = (GstCollectData *) (pad);
|
|
||||||
|
|
||||||
/* There is now (at least) one such alement (kateenc), and I'm going
|
/* There is now (at least) one such alement (kateenc), and I'm going
|
||||||
to handle it here and claim it works when it can be piped back
|
to handle it here and claim it works when it can be piped back
|
||||||
through GStreamer and VLC */
|
through GStreamer and VLC */
|
||||||
|
@ -2265,6 +2263,7 @@ gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
GstMatroskaTrackSubtitleContext *scontext;
|
GstMatroskaTrackSubtitleContext *scontext;
|
||||||
GstMatroskaMux *mux;
|
GstMatroskaMux *mux;
|
||||||
GstMatroskaPad *collect_pad;
|
GstMatroskaPad *collect_pad;
|
||||||
|
GstCollectData *data;
|
||||||
const gchar *mimetype;
|
const gchar *mimetype;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const GValue *value = NULL;
|
const GValue *value = NULL;
|
||||||
|
@ -2293,6 +2292,8 @@ gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
/* find context */
|
/* find context */
|
||||||
collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad);
|
collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad);
|
||||||
g_assert (collect_pad);
|
g_assert (collect_pad);
|
||||||
|
data = (GstCollectData *) (collect_pad);
|
||||||
|
|
||||||
context = collect_pad->track;
|
context = collect_pad->track;
|
||||||
g_assert (context);
|
g_assert (context);
|
||||||
g_assert (context->type == GST_MATROSKA_TRACK_TYPE_SUBTITLE);
|
g_assert (context->type == GST_MATROSKA_TRACK_TYPE_SUBTITLE);
|
||||||
|
@ -2373,10 +2374,8 @@ gst_matroska_mux_subtitle_pad_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
GST_COLLECT_PADS_STREAM_LOCK (mux->collect);
|
GST_COLLECT_PADS_STREAM_LOCK (mux->collect);
|
||||||
GST_COLLECT_PADS_STATE_UNSET (data, GST_COLLECT_PADS_STATE_LOCKED);
|
GST_COLLECT_PADS_STATE_UNSET (data, GST_COLLECT_PADS_STATE_LOCKED);
|
||||||
gst_collect_pads_set_waiting (mux->collect, data, FALSE);
|
gst_collect_pads_set_waiting (mux->collect, data, FALSE);
|
||||||
GST_COLLECT_PADS_STATE_SET (data, GST_COLLECT_PADS_STATE_LOCKED);
|
|
||||||
GST_COLLECT_PADS_STREAM_UNLOCK (mux->collect);
|
GST_COLLECT_PADS_STREAM_UNLOCK (mux->collect);
|
||||||
|
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue