[FFmpeg-cvslog] avcodec/vp8: Fix undefined shifts in vp8_mc_luma()

Michael Niedermayer git at videolan.org
Wed Mar 11 17:42:23 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Mar 11 16:55:07 2015 +0100| [9b2a964ceeaba09fbd71a82ce58344614761e9ee] | committer: Michael Niedermayer

avcodec/vp8: Fix undefined shifts in vp8_mc_luma()

Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu at google.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b2a964ceeaba09fbd71a82ce58344614761e9ee
---

 libavcodec/vp8.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 448710b..4b32347 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1721,8 +1721,8 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
     if (AV_RN32A(mv)) {
         int src_linesize = linesize;
 
-        int mx = (mv->x << 1) & 7, mx_idx = subpel_idx[0][mx];
-        int my = (mv->y << 1) & 7, my_idx = subpel_idx[0][my];
+        int mx = (mv->x * 2) & 7, mx_idx = subpel_idx[0][mx];
+        int my = (mv->y * 2) & 7, my_idx = subpel_idx[0][my];
 
         x_off += mv->x >> 2;
         y_off += mv->y >> 2;



More information about the ffmpeg-cvslog mailing list