mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-08 04:41:31 +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;
|
info->position[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (!check_valid_channel_positions (position, channels, TRUE, NULL)) {
|
if (!position
|
||||||
g_warning ("Invalid channel positions");
|
|| !check_valid_channel_positions (position, channels, TRUE, NULL)) {
|
||||||
|
if (position)
|
||||||
|
g_warning ("Invalid channel positions");
|
||||||
} else {
|
} else {
|
||||||
memcpy (&info->position, position,
|
memcpy (&info->position, position,
|
||||||
info->channels * sizeof (info->position[0]));
|
info->channels * sizeof (info->position[0]));
|
||||||
|
|
Loading…
Reference in a new issue