summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-11 17:59:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-11 17:59:59 +0100
commit2391e46430fa2af28542124dbcfc935c0a5ce82c (patch)
tree71af28002876de1136143c2e6654fd888e2cfbb1 /libavcodec/mpegvideo.c
parent9b2a964ceeaba09fbd71a82ce58344614761e9ee (diff)
avcodec/mpegvideo: Fix undefined shift in ff_mpv_lowest_referenced_row()
Also moves the shift out of the inner loop Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 64ee632e59..1f2fc1b556 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2952,12 +2952,12 @@ int ff_mpv_lowest_referenced_row(MpegEncContext *s, int dir)
}
for (i = 0; i < mvs; i++) {
- my = s->mv[dir][i][1]<<qpel_shift;
+ my = s->mv[dir][i][1];
my_max = FFMAX(my_max, my);
my_min = FFMIN(my_min, my);
}
- off = (FFMAX(-my_min, my_max) + 63) >> 6;
+ off = ((FFMAX(-my_min, my_max)<<qpel_shift) + 63) >> 6;
return FFMIN(FFMAX(s->mb_y + off, 0), s->mb_height-1);
unhandled: