[FFmpeg-cvslog] avcodec/libxvid: fix potential integer overflow

Michael Niedermayer git at videolan.org
Wed Jan 7 18:23:16 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan  7 17:23:25 2015 +0100| [e00499eb4c80752b2c464f3a98bf0b6ce7b1e212] | committer: Michael Niedermayer

avcodec/libxvid: fix potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/libxvid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 7669fee..b6840ee 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -713,7 +713,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     xvid_enc_frame_t xvid_enc_frame = { 0 };
     xvid_enc_stats_t xvid_enc_stats = { 0 };
 
-    if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0)
+    if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*(int64_t)mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0)
         return ret;
 
     /* Start setting up the frame */



More information about the ffmpeg-cvslog mailing list