From 710b0e27025948b7511821c2f888ff2d74a59e14 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 11 Sep 2013 15:25:13 +0300 Subject: smacker: Avoid integer overflow when allocating packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavformat/smacker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/smacker.c') diff --git a/libavformat/smacker.c b/libavformat/smacker.c index a15bded119..f8a0769acd 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -327,7 +327,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) } flags >>= 1; } - if (frame_size < 0) + if (frame_size < 0 || frame_size >= INT_MAX/2) return AVERROR_INVALIDDATA; if (av_new_packet(pkt, frame_size + 769)) return AVERROR(ENOMEM); -- cgit v1.2.3