diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-12 20:50:13 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-09-13 17:25:45 +0200 |
commit | 2ac3aa129e7dbee5d6e19e27794706c8f2ee8345 (patch) | |
tree | f34f568804c3943af62a3fb0362fc051ea0106e7 | |
parent | 1486e99b9039f380619f7eb516a5503ad3ad04c8 (diff) | |
download | ffmpeg-2ac3aa129e7dbee5d6e19e27794706c8f2ee8345.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) |