summaryrefslogtreecommitdiff
path: root/libavcodec/vc1_pred.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-11 13:16:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-11 13:16:47 +0100
commite5dfa4361955803ac10911a005803c1e514b6ca7 (patch)
treebf17b3c4c2172129efcbb340649fdc16b95572b1 /libavcodec/vc1_pred.c
parent1932f7e2eee07e4a50e014a625dca79a9f9dba7a (diff)
downloadffmpeg-e5dfa4361955803ac10911a005803c1e514b6ca7.tar.gz
avcodec/vc1_pred: Fix undefined shift in ff_vc1_pred_mv()
Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1_pred.c')
-rw-r--r--libavcodec/vc1_pred.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c
index f74992b70d..35c75abd83 100644
--- a/libavcodec/vc1_pred.c
+++ b/libavcodec/vc1_pred.c
@@ -231,8 +231,10 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
else
mixedmv_pic = 0;
/* scale MV difference to be quad-pel */
- dmv_x <<= 1 - s->quarter_sample;
- dmv_y <<= 1 - s->quarter_sample;
+ if (!s->quarter_sample) {
+ dmv_x *= 2;
+ dmv_y *= 2;
+ }
wrap = s->b8_stride;
xy = s->block_index[n];