[libav-stable] mpegvideo: Avoid 32-bit wrapping of linesize multiplications

Martin Storsjö git at libav.org
Wed Sep 4 13:36:42 CEST 2013

Module: libav
Branch: master
Commit: a711a2cb473dc95708f371a82c85c97fe789b5c2

Author:    Martin Storsjö <martin at martin.st>
Committer: Martin Storsjö <martin at martin.st>
Date:      Wed Sep  4 01:36:51 2013 +0300

mpegvideo: Avoid 32-bit wrapping of linesize multiplications

This makes sure that linesize * start_y doesn't overflow, so that
emulated_edge_mc can get back the original value if needed.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>


 libavcodec/mpegvideo_motion.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index c8109b1..cbf200f 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -217,7 +217,8 @@ 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, uvlinesize, linesize;
+        uvsrc_x, uvsrc_y, v_edge_pos;
+    ptrdiff_t uvlinesize, linesize;
 #if 0

More information about the libav-stable mailing list