mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
opus: Fix crash when getting unexpected channel position
gst_opus_channel_names is a static array with only 13 items. GstAudioChannelPosition have bigger values than that. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4798>
This commit is contained in:
parent
2769986ca9
commit
b687e19e10
1 changed files with 3 additions and 4 deletions
|
@ -508,8 +508,7 @@ gst_opus_enc_find_channel_position_in_vorbis_order (GstOpusEnc * enc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GST_WARNING_OBJECT (enc,
|
GST_WARNING_OBJECT (enc,
|
||||||
"Channel position %s is not representable in Vorbis order",
|
"Channel position %d is not representable in Vorbis order", position);
|
||||||
gst_opus_channel_names[position]);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,8 +614,8 @@ gst_opus_enc_setup_channel_mappings (GstOpusEnc * enc,
|
||||||
needs to be done */
|
needs to be done */
|
||||||
if (!positions_done[position]) {
|
if (!positions_done[position]) {
|
||||||
int cv;
|
int cv;
|
||||||
GST_DEBUG_OBJECT (enc, "Channel position %s is not mapped yet, adding",
|
GST_DEBUG_OBJECT (enc, "Channel position %d is not mapped yet, adding",
|
||||||
gst_opus_channel_names[position]);
|
position);
|
||||||
cv = gst_opus_enc_find_channel_position_in_vorbis_order (enc, position);
|
cv = gst_opus_enc_find_channel_position_in_vorbis_order (enc, position);
|
||||||
if (cv < 0)
|
if (cv < 0)
|
||||||
goto unpositioned;
|
goto unpositioned;
|
||||||
|
|
Loading…
Reference in a new issue