avsdemux: check for corrupted data

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

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Laurent Aimar
2011-09-30 23:42:31 +00:00
committed by Reinhard Tartler
parent a23bcc923d
commit b696d61518

View File

@@ -163,6 +163,8 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
sub_type = avio_r8(s->pb); sub_type = avio_r8(s->pb);
type = avio_r8(s->pb); type = avio_r8(s->pb);
size = avio_rl16(s->pb); size = avio_rl16(s->pb);
if (size < 4)
return AVERROR_INVALIDDATA;
avs->remaining_frame_size -= size; avs->remaining_frame_size -= size;
switch (type) { switch (type) {