diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index b5b94854fe..1f5142871c 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -2881,7 +2881,7 @@ gst_matroska_mux_start (GstMatroskaMux * mux) thepad = collect_pad->collect.pad; if (gst_pad_is_linked (thepad) && gst_pad_is_active (thepad) && - collect_pad->track->codec_id != 0) { + collect_pad->track->codec_id != NULL) { collect_pad->track->num = tracknum++; child = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_TRACKENTRY); gst_matroska_mux_track_header (mux, collect_pad->track); @@ -3544,12 +3544,11 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad, } /* for dirac we have to queue up everything up to a picture unit */ - if (!g_strcmp0 (collect_pad->track->codec_id, - GST_MATROSKA_CODEC_ID_VIDEO_DIRAC)) { + if (!strcmp (collect_pad->track->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_DIRAC)) { buf = gst_matroska_mux_handle_dirac_packet (mux, collect_pad, buf); if (!buf) return GST_FLOW_OK; - } else if (!g_strcmp0 (collect_pad->track->codec_id, + } else if (!strcmp (collect_pad->track->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_PRORES)) { /* Remove the 'Frame container atom' header' */ buf = gst_buffer_make_writable (buf); @@ -3820,6 +3819,12 @@ gst_matroska_mux_handle_buffer (GstCollectPads * pads, GstCollectData * data, goto exit; } + if (best->track->codec_id == NULL) { + GST_ERROR_OBJECT (best->collect.pad, "No codec-id for pad"); + ret = GST_FLOW_NOT_NEGOTIATED; + goto exit; + } + /* if we have a best stream, should also have a buffer */ g_assert (buf);