aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 15:25:13 +0300
committerLuca Barbato <lu_zero@gentoo.org>2013-10-03 20:29:24 +0200
commit47bb4d888e1ef84b29aec4641a737c3aa35663a7 (patch)
treeedba551ca45128efc37e1c9ae604a78c78e385f8
parent057f655dc6a9a14224dd3d557606eedf15dfe64c (diff)
downloadffmpeg-47bb4d888e1ef84b29aec4641a737c3aa35663a7.tar.gz
smacker: Avoid integer overflow when allocating packets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 710b0e27025948b7511821c2f888ff2d74a59e14) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavformat/smacker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 56a75d8fa1..a6a6933e6b 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);