]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_rtp.c: MulticastRTP missing refcount without codec option
authorPeterHolik <peter@holik.at>
Mon, 15 Jan 2024 11:28:15 +0000 (12:28 +0100)
committerPeterHolik <peter@holik.at>
Wed, 17 Jan 2024 14:15:24 +0000 (14:15 +0000)
Fixes: #529
channels/chan_rtp.c

index d6342c47c21434c97521dbd5103ed6e3e9d9f9e0..97fc2408c3ea37a6ccfd0f1cef9c41a3e651993a 100644 (file)
@@ -129,7 +129,8 @@ static struct ast_format *derive_format_from_cap(struct ast_format_cap *cap)
                 * assignments. Signed linear @ 8kHz does not map, so if that is our
                 * only capability, we force μ-law instead.
                 */
-               fmt = ast_format_ulaw;
+               ao2_ref(fmt, -1);
+               fmt = ao2_bump(ast_format_ulaw);
        }
 
        return fmt;