From c341f734e5f9d6af4a8fdcceb6f5d12de6395c76 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 27 Sep 2013 20:13:59 -0400 Subject: Convert multiplier for MV from int to ptrdiff_t. This prevents emulated_edge_mc from not undoing mvy*stride-related integer overflows. Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_motion.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libavcodec/mpegvideo_motion.c') diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 3851739512..e5b7e4648a 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -38,7 +38,8 @@ static void gmc1_motion(MpegEncContext *s, uint8_t **ref_picture) { uint8_t *ptr; - int offset, src_x, src_y, linesize, uvlinesize; + int src_x, src_y; + ptrdiff_t offset, linesize, uvlinesize; int motion_x, motion_y; int emu=0; @@ -215,7 +216,7 @@ void mpeg_motion_internal(MpegEncContext *s, uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos; - emuedge_linesize_type uvlinesize, linesize; + ptrdiff_t uvlinesize, linesize; #if 0 if(s->quarter_sample) @@ -459,7 +460,8 @@ static inline void qpel_motion(MpegEncContext *s, int motion_x, int motion_y, int h) { uint8_t *ptr_y, *ptr_cb, *ptr_cr; - int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, linesize, uvlinesize; + int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos; + ptrdiff_t linesize, uvlinesize; dxy = ((motion_y & 3) << 2) | (motion_x & 3); src_x = s->mb_x * 16 + (motion_x >> 2); @@ -552,7 +554,8 @@ static void chroma_4mv_motion(MpegEncContext *s, op_pixels_func *pix_op, int mx, int my) { - int dxy, emu=0, src_x, src_y, offset; + int dxy, emu=0, src_x, src_y; + ptrdiff_t offset; uint8_t *ptr; /* In case of 8X8, we construct a single chroma motion vector -- cgit v1.2.1