]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
frame.c: validate frame data length is less than samples when adjusting volume
authormkmer <mike.j.kasper@gmail.com>
Mon, 12 May 2025 14:18:19 +0000 (10:18 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 20 May 2025 13:54:08 +0000 (13:54 +0000)
Resolves: #1230

main/frame.c

index 711f9e15f104d6a71d071f948087335d46546bd9..e9e36635309e14f2b6e901904e4f61d3c7da5959 100644 (file)
@@ -817,9 +817,7 @@ int ast_frame_adjust_volume_float(struct ast_frame *f, float adjustment)
 
        if ((f->frametype != AST_FRAME_VOICE) || !(ast_format_cache_is_slinear(f->subclass.format))) {
                return -1;
-       }
-
-       if (!adjustment) {
+       } else if (!adjustment || (f->samples > f->datalen)) {
                return 0;
        }