Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/dpcm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 069bf1dcd8..7078419f08 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -321,9 +321,8 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
shift[ch] -= (2 * n);
diff = sign_extend((diff &~ 3) << 8, 16);
- /* saturate the shifter to a lower limit of 0 */
- if (shift[ch] < 0)
- shift[ch] = 0;
+ /* saturate the shifter to 0..31 */
+ shift[ch] = av_clip_uintp2(shift[ch], 5);
diff >>= shift[ch];
predictor[ch] += diff;