diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-10-28 21:35:55 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-10-28 21:35:55 +0000 |
commit | 8dad624c68b5f920f810f76e3b49741f991b6ae6 (patch) | |
tree | 516b6bc501ba5df920323c0dfd62cd355698de65 /frame.c | |
parent | c24ba6ac5edf876e9c018faf2c604eb1e3b97d45 (diff) |
ensure that SLINEAR volume adjustments don't wrap around short integer maximums
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'frame.c')
-rwxr-xr-x | frame.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1263,9 +1263,9 @@ int ast_frame_adjust_volume(struct ast_frame *f, int adjustment) for (count = 0; count < f->samples; count++) { if (adjustment > 0) { - fdata[count] *= abs(adjustment); + ast_slinear_saturated_multiply(&fdata[count], abs(adjustment)); } else if (adjustment < 0) { - fdata[count] /= abs(adjustment); + ast_slinear_saturated_divide(&fdata[count], abs(adjustment)); } } |