Skip to content

Commit 2c75f2e

Browse files
committed
frame.c: validate frame data length is less than samples when adjusting volume
Resolves: asterisk#1230
1 parent 8f1982c commit 2c75f2e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

main/frame.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,7 @@ int ast_frame_adjust_volume_float(struct ast_frame *f, float adjustment)
817817

818818
if ((f->frametype != AST_FRAME_VOICE) || !(ast_format_cache_is_slinear(f->subclass.format))) {
819819
return -1;
820-
}
821-
822-
if (!adjustment) {
820+
} else if (!adjustment || (f->samples > f->datalen)) {
823821
return 0;
824822
}
825823

0 commit comments

Comments
 (0)