[FFmpeg-cvslog] Check for invalid packet size in the smacker demuxer.

Laurent Aimar git at videolan.org
Thu Sep 22 01:17:28 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Mon Sep 12 20:50:13 2011 +0200| [2ac3aa129e7dbee5d6e19e27794706c8f2ee8345] | committer: Anton Khirnov

Check for invalid packet size in the smacker demuxer.

Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ac3aa129e7dbee5d6e19e27794706c8f2ee8345
---

 libavformat/smacker.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 135b4ae..87c59a3 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)



More information about the ffmpeg-cvslog mailing list