matroskademux: fix crash with 24-bit raw audio

Do not try to align audio buffers to odd numbers,
which will get us a NULL buffer which we then
crash on.

https://bugzilla.gnome.org/show_bug.cgi?id=725008
This commit is contained in:
Matej Knopp 2014-02-23 19:09:24 +01:00 committed by Tim-Philipp Müller
parent 5bad2d8b70
commit d33b4dce63

View file

@ -5265,6 +5265,8 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
*codec_name = g_strdup_printf ("Raw %d-bit PCM audio",
audiocontext->bitdepth);
context->alignment = audiocontext->bitdepth / 8;
if (context->alignment > 1 && context->alignment % 2)
++context->alignment;
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT)) {
const gchar *format;
if (audiocontext->bitdepth == 32)
@ -5278,6 +5280,8 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
*codec_name = g_strdup_printf ("Raw %d-bit floating-point audio",
audiocontext->bitdepth);
context->alignment = audiocontext->bitdepth / 8;
if (context->alignment > 1 && context->alignment % 2)
++context->alignment;
} else if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_AC3,
strlen (GST_MATROSKA_CODEC_ID_AUDIO_AC3))) {
caps = gst_caps_new_simple ("audio/x-ac3",