mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
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:
parent
5bad2d8b70
commit
d33b4dce63
1 changed files with 4 additions and 0 deletions
|
@ -5265,6 +5265,8 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *
|
||||||
*codec_name = g_strdup_printf ("Raw %d-bit PCM audio",
|
*codec_name = g_strdup_printf ("Raw %d-bit PCM audio",
|
||||||
audiocontext->bitdepth);
|
audiocontext->bitdepth);
|
||||||
context->alignment = audiocontext->bitdepth / 8;
|
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)) {
|
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT)) {
|
||||||
const gchar *format;
|
const gchar *format;
|
||||||
if (audiocontext->bitdepth == 32)
|
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",
|
*codec_name = g_strdup_printf ("Raw %d-bit floating-point audio",
|
||||||
audiocontext->bitdepth);
|
audiocontext->bitdepth);
|
||||||
context->alignment = audiocontext->bitdepth / 8;
|
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,
|
} else if (!strncmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_AC3,
|
||||||
strlen (GST_MATROSKA_CODEC_ID_AUDIO_AC3))) {
|
strlen (GST_MATROSKA_CODEC_ID_AUDIO_AC3))) {
|
||||||
caps = gst_caps_new_simple ("audio/x-ac3",
|
caps = gst_caps_new_simple ("audio/x-ac3",
|
||||||
|
|
Loading…
Reference in a new issue