From b226b62ae331f8c69c1c09bf2e1719fd8d53318e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 7 Jun 2023 14:24:46 -0400 Subject: [PATCH] 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: --- subprojects/gst-plugins-base/ext/opus/gstopusenc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-base/ext/opus/gstopusenc.c b/subprojects/gst-plugins-base/ext/opus/gstopusenc.c index 6f1fc2b..f66dc99 100644 --- a/subprojects/gst-plugins-base/ext/opus/gstopusenc.c +++ b/subprojects/gst-plugins-base/ext/opus/gstopusenc.c @@ -508,8 +508,7 @@ gst_opus_enc_find_channel_position_in_vorbis_order (GstOpusEnc * enc, } } GST_WARNING_OBJECT (enc, - "Channel position %s is not representable in Vorbis order", - gst_opus_channel_names[position]); + "Channel position %d is not representable in Vorbis order", position); return -1; } @@ -620,8 +619,8 @@ gst_opus_enc_setup_channel_mappings (GstOpusEnc * enc, needs to be done */ if (!positions_done[position]) { int cv; - GST_DEBUG_OBJECT (enc, "Channel position %s is not mapped yet, adding", - gst_opus_channel_names[position]); + GST_DEBUG_OBJECT (enc, "Channel position %d is not mapped yet, adding", + position); cv = gst_opus_enc_find_channel_position_in_vorbis_order (enc, position); if (cv < 0) g_assert_not_reached (); -- 2.7.4