summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-07-01 13:41:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-07-01 13:42:06 +0200
commit4eee685a212a1e189860dfc27d14e41130c730c1 (patch)
tree41ae590c29778a43c871927376b963bf4ae3db2b /libavcodec/motion_est.c
parent0ea099ad3e6d82a09538ad2c93e193187d70345d (diff)
avcodec/motion_est: Fix undefined shifts in cmp_inline()
Fixes: signal_sigsegv_35eac16_2762_cov_2704249783_missing_frames.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 96aa9ac84e..9e184df74a 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -183,8 +183,8 @@ static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int
const int stride= c->stride;
const int uvstride= c->uvstride;
const int dxy= subx + (suby<<(1+qpel)); //FIXME log2_subpel?
- const int hx= subx + (x<<(1+qpel));
- const int hy= suby + (y<<(1+qpel));
+ const int hx= subx + x*(1<<(1+qpel));
+ const int hy= suby + y*(1<<(1+qpel));
uint8_t * const * const ref= c->ref[ref_index];
uint8_t * const * const src= c->src[src_index];
int d;