Check for corrupted data in avs demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 30 Sep 2011 22:44:54 +0000 (00:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 1 Oct 2011 00:41:39 +0000 (02:41 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avs.c

index 89b2642..7b90f85 100644 (file)
@@ -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) {