diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-12 20:50:13 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-09-26 19:26:32 +0200 |
commit | 4e7905fa9ee75eed404db4d2cca69f833452bf72 (patch) | |
tree | c313b479a2b91846d34602f7ea90a7ee1fda6bc1 | |
parent | 4ee014309c377f7cfaa9578a393864ae500136f6 (diff) | |
download | ffmpeg-4e7905fa9ee75eed404db4d2cca69f833452bf72.tar.gz |
Check for invalid packet size in the smacker demuxer.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavformat/smacker.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 135b4ae708..87c59a3049 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -304,6 +304,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) } flags >>= 1; } + if (frame_size < 0) + return AVERROR_INVALIDDATA; if (av_new_packet(pkt, frame_size + 768)) return AVERROR(ENOMEM); if(smk->frm_size[smk->cur_frame] & 1) |