From: mkmer Date: Mon, 12 May 2025 14:18:19 +0000 (-0400) Subject: frame.c: validate frame data length is less than samples when adjusting volume X-Git-Tag: 21.10.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8955c13c67901d490fc0e8adf03370711dd191d8;p=thirdparty%2Fasterisk.git frame.c: validate frame data length is less than samples when adjusting volume Resolves: #1230 (cherry picked from commit 113c7d0a8d0bdfb66b4e41e60470c2795c3b185c) --- diff --git a/main/frame.c b/main/frame.c index 711f9e15f1..e9e3663530 100644 --- a/main/frame.c +++ b/main/frame.c @@ -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; }