From e00499eb4c80752b2c464f3a98bf0b6ce7b1e212 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 7 Jan 2015 17:23:25 +0100 Subject: [PATCH] avcodec/libxvid: fix potential integer overflow Signed-off-by: Michael Niedermayer --- libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 7669fee943..b6840ee358 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 */