aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 15:25:13 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:56 +0100
commit68a1df13c460adb6241cfdf96aad953b5d637623 (patch)
tree63cb15ca95708177c84caab9b1fcac7acae8de4f
parent61032c577db0421c332d0eea10a00748353b38ee (diff)
downloadffmpeg-68a1df13c460adb6241cfdf96aad953b5d637623.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 3d5a3b8d72..92b91b7144 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -320,7 +320,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);