From 48f641a18b841c8704b741b59ae71e4bc129e07f Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 2 Sep 2015 13:47:22 -0400 Subject: [PATCH] vp9: clip intermediates in dequant calculations. This makes values consistent with libvpx. --- libavcodec/vp9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 3eff1f180b..95af94b29b 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -785,9 +785,9 @@ static int decode_frame_header(AVCodecContext *ctx, if (s->segmentation.feat[i].q_enabled) { if (s->segmentation.absolute_vals) - qyac = s->segmentation.feat[i].q_val; + qyac = av_clip_uintp2(s->segmentation.feat[i].q_val, 8); else - qyac = s->yac_qi + s->segmentation.feat[i].q_val; + qyac = av_clip_uintp2(s->yac_qi + s->segmentation.feat[i].q_val, 8); } else { qyac = s->yac_qi; }