frame.c: validate frame data length is less than samples when adjusting volume

Resolves: #1230
This commit is contained in:
mkmer
2025-05-12 10:18:19 -04:00
committed by github-actions[bot]
parent 3924a828ff
commit abf3f78c81

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