Commit e4a5f091 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

matroskademux: Fix possible NULL pointer dereference and assertion that could...

matroskademux: Fix possible NULL pointer dereference and assertion that could be caused by invalid files
parent 20b90222
......@@ -6432,7 +6432,7 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
}
} else if (g_str_has_prefix (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_AAC)) {
GstBuffer *priv = NULL;
gint mpegversion = -1;
gint mpegversion;
gint rate_idx, profile;
guint8 *data = NULL;
......@@ -6472,7 +6472,6 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
data[0] = ((profile + 1) << 3) | ((rate_idx & 0xE) >> 1);
data[1] = ((rate_idx & 0x1) << 7) | (audiocontext->channels << 3);
GST_BUFFER_SIZE (priv) = 2;
}
if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG2,
strlen (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG2))) {
......@@ -6491,16 +6490,19 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
GST_BUFFER_SIZE (priv) = 5;
}
} else {
g_assert_not_reached ();
gst_buffer_unref (priv);
priv = NULL;
GST_ERROR ("Unknown AAC profile and no codec private data");
}
}
if (priv) {
caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, mpegversion,
"framed", G_TYPE_BOOLEAN, TRUE, NULL);
if (priv) {
gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, priv, NULL);
}
*codec_name = g_strdup_printf ("MPEG-%d AAC audio", mpegversion);
}
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_TTA)) {
caps = gst_caps_new_simple ("audio/x-tta",
"width", G_TYPE_INT, audiocontext->bitdepth, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment