[FFmpeg-cvslog] smacker: Avoid integer overflow when allocating packets
Martin Storsjö
git at videolan.org
Tue Oct 8 00:46:12 CEST 2013
ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Wed Sep 11 15:25:13 2013 +0300| [47bb4d888e1ef84b29aec4641a737c3aa35663a7] | committer: Luca Barbato
smacker: Avoid integer overflow when allocating packets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 710b0e27025948b7511821c2f888ff2d74a59e14)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47bb4d888e1ef84b29aec4641a737c3aa35663a7
---
libavformat/smacker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 56a75d8..a6a6933 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);
More information about the ffmpeg-cvslog
mailing list