]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_opus] Fix buf scope in switch_opus_decode().
authorAndrey Volk <andywolk@gmail.com>
Fri, 28 Oct 2022 00:15:15 +0000 (03:15 +0300)
committerAndrey Volk <andywolk@gmail.com>
Mon, 10 Apr 2023 12:10:17 +0000 (15:10 +0300)
src/mod/codecs/mod_opus/mod_opus.c

index d24590f37a0c68f15a190adbc0a067f46f65667f..04850a672e36002f699b78965048479b5f083ef3 100644 (file)
@@ -817,6 +817,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
        int fec = 0, plc = 0;
        int32_t frame_size = 0, last_frame_size = 0;
        uint32_t frame_samples;
+       uint8_t buf[SWITCH_RTP_MAX_BUF_LEN];
 
        if (!context) {
                return SWITCH_STATUS_FALSE;
@@ -842,7 +843,6 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
                        }
                        if (codec->cur_frame && (jb = switch_core_session_get_jb(session, SWITCH_MEDIA_TYPE_AUDIO))) {
                                switch_frame_t frame = { 0 };
-                               uint8_t buf[SWITCH_RTP_MAX_BUF_LEN];
                                uint32_t ts = 0;
                                uint16_t seq = 0;