summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-03-17 12:58:03 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2012-03-18 15:25:25 -0700
commit89f3aa8ce20a68c106c7694af44fd9cab00fd26b (patch)
treefc93ff819c90dc1109302814744f53b5915d4fce /libavcodec/adpcm.c
parent689be85a9aa9323ff498519a6de5d86138a06eed (diff)
adpcm: use av_clip() in adpcm_ima_expand_nibble().
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index ed6d0c5028..ab9f77b21c 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -150,8 +150,7 @@ static inline short adpcm_ima_expand_nibble(ADPCMChannelStatus *c, char nibble,
step = ff_adpcm_step_table[c->step_index];
step_index = c->step_index + ff_adpcm_index_table[(unsigned)nibble];
- if (step_index < 0) step_index = 0;
- else if (step_index > 88) step_index = 88;
+ step_index = av_clip(step_index, 0, 88);
sign = nibble & 8;
delta = nibble & 7;