Commit 2a187a07 authored by Alexandra Hájková's avatar Alexandra Hájková Committed by Anton Khirnov

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

Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 93f16f33
...@@ -776,6 +776,8 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable * ...@@ -776,6 +776,8 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
asf_st->span = span; asf_st->span = span;
asf_st->virtual_pkt_len = avio_rl16(pb); asf_st->virtual_pkt_len = avio_rl16(pb);
asf_st->virtual_chunk_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); avio_skip(pb, err_data_len - 5);
} else } else
avio_skip(pb, err_data_len - 1); avio_skip(pb, err_data_len - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment