Browse code

avsdemux: check for corrupted data

Signed-off-by: Janne Grunau <janne-libav@jannau.net>

Laurent Aimar authored on 2011/10/01 08:42:31
Showing 1 changed files
... ...
@@ -163,6 +163,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
163 163
             sub_type = avio_r8(s->pb);
164 164
             type = avio_r8(s->pb);
165 165
             size = avio_rl16(s->pb);
166
+            if (size < 4)
167
+                return AVERROR_INVALIDDATA;
166 168
             avs->remaining_frame_size -= size;
167 169
 
168 170
             switch (type) {