aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-10 18:57:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit4ca1bcdfca019f925d162786f23ff2912c6155ff (patch)
tree405477f35bc5898841aed8bf623e42e3f8079e95
parentc92c220d2cba85f08675824e81fb563693001a94 (diff)
downloadffmpeg-4ca1bcdfca019f925d162786f23ff2912c6155ff.tar.gz
avcodec/vc1_pred: Fix invalid shifts in scaleforopp()
Fixes: left shift of negative value -2 Fixes: 16964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5757853565976576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ced9a1cd0ab76a65e509b0d7c56965d61ea1df84) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vc1_pred.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c
index a126677c72..dadbdf500c 100644
--- a/libavcodec/vc1_pred.c
+++ b/libavcodec/vc1_pred.c
@@ -191,9 +191,9 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
n >>= hpel;
if (v->s.pict_type == AV_PICTURE_TYPE_B && !v->second_field && dir == 1) {
if (dim)
- n = scaleforopp_y(v, n, dir) << hpel;
+ n = scaleforopp_y(v, n, dir) * (1 << hpel);
else
- n = scaleforopp_x(v, n) << hpel;
+ n = scaleforopp_x(v, n) * (1 << hpel);
return n;
}
if (v->s.pict_type != AV_PICTURE_TYPE_B)