mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
audio: Don't crash if NULL positions are passed to gst_audio_info_set_format()
This commit is contained in:
parent
5cb3d75dbf
commit
67c8b0dfbd
1 changed files with 4 additions and 2 deletions
|
@ -484,8 +484,10 @@ gst_audio_info_set_format (GstAudioInfo * info, GstAudioFormat format,
|
|||
info->position[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
||||
return;
|
||||
} else {
|
||||
if (!check_valid_channel_positions (position, channels, TRUE, NULL)) {
|
||||
g_warning ("Invalid channel positions");
|
||||
if (!position
|
||||
|| !check_valid_channel_positions (position, channels, TRUE, NULL)) {
|
||||
if (position)
|
||||
g_warning ("Invalid channel positions");
|
||||
} else {
|
||||
memcpy (&info->position, position,
|
||||
info->channels * sizeof (info->position[0]));
|
||||
|
|
Loading…
Reference in a new issue