[FFmpeg-cvslog] avsdemux: check for corrupted data

Laurent Aimar git at videolan.org
Mon Mar 19 05:30:34 CET 2012


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Fri Sep 30 23:42:31 2011 +0000| [b696d61518bba0514cf72ce765572275d12c0bf7] | committer: Reinhard Tartler

avsdemux: check for corrupted data

Signed-off-by: Janne Grunau <janne-libav at jannau.net>
(cherry picked from commit 76c6971a6464705f263fc30e537b370a3a7c853b)

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

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

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

diff --git a/libavformat/avs.c b/libavformat/avs.c
index bd9b31d..52294b0 100644
--- a/libavformat/avs.c
+++ b/libavformat/avs.c
@@ -163,6 +163,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
             sub_type = avio_r8(s->pb);
             type = avio_r8(s->pb);
             size = avio_rl16(s->pb);
+            if (size < 4)
+                return AVERROR_INVALIDDATA;
             avs->remaining_frame_size -= size;
 
             switch (type) {



More information about the ffmpeg-cvslog mailing list