From d33b4dce63c967dedd5477fc76ecd27fec434d49 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Sun, 23 Feb 2014 19:09:24 +0100 Subject: [PATCH] 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 --- gst/matroska/matroska-demux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index aaa60a94dc..f7eb034dcf 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -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", -- 2.34.1