asfdec: avoid crash in the case when chunk_len is 0 or pkt_len is 0

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Alexandra Hájková 2015-07-21 10:45:01 +02:00 committed by Anton Khirnov
parent 93f16f338f
commit 2a187a074a

View File

@ -776,6 +776,8 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
asf_st->span = span;
asf_st->virtual_pkt_len = avio_rl16(pb);
asf_st->virtual_chunk_len = avio_rl16(pb);
if (!asf_st->virtual_chunk_len || !asf_st->virtual_pkt_len)
return AVERROR_INVALIDDATA;
avio_skip(pb, err_data_len - 5);
} else
avio_skip(pb, err_data_len - 1);