]> 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)
committerGeorge Joseph <gjoseph@sangoma.com>
Thu, 26 Jun 2025 18:15:04 +0000 (12:15 -0600)
Resolves: #1230
(cherry picked from commit 113c7d0a8d0bdfb66b4e41e60470c2795c3b185c)

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;
        }