diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-09-27 20:13:59 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-28 11:28:09 +0200 |
commit | c341f734e5f9d6af4a8fdcceb6f5d12de6395c76 (patch) | |
tree | 42c66699b2e6685e3c4ab67d32a6d0dec7a6e2be /libavcodec/mpegvideo_motion.c | |
parent | 7381d31f2267489ed5e939707b7e77a20adc168d (diff) | |
download | ffmpeg-c341f734e5f9d6af4a8fdcceb6f5d12de6395c76.tar.gz |
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 <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_motion.c')
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 11 |
1 files changed, 7 insertions, 4 deletions
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 |