[FFmpeg-cvslog] Check for corrupted data in avs demuxer.

Laurent Aimar git at videolan.org
Sun Nov 6 20:18:53 CET 2011


ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Sat Oct  1 00:44:54 2011 +0200| [2e1e3c1e41b67b11d06e077255e31886550510c6] | committer: Michael Niedermayer

Check for corrupted data in avs demuxer.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 1cce7def0a8eff2e7db294b7d195a0fb1a5043b0)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/avs.c b/libavformat/avs.c
index 1fcb19f..878898e 100644
--- a/libavformat/avs.c
+++ b/libavformat/avs.c
@@ -163,6 +163,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
             sub_type = get_byte(s->pb);
             type = get_byte(s->pb);
             size = get_le16(s->pb);
+            if (size < 4)
+                return AVERROR_INVALIDDATA;
             avs->remaining_frame_size -= size;
 
             switch (type) {



More information about the ffmpeg-cvslog mailing list