From 89f3aa8ce20a68c106c7694af44fd9cab00fd26b Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 17 Mar 2012 12:58:03 -0700 Subject: adpcm: use av_clip() in adpcm_ima_expand_nibble(). --- libavcodec/adpcm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavcodec/adpcm.c') 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; -- cgit v1.2.3