diff options
author | Alexandra Hájková <alexandra.khirnova@gmail.com> | 2015-07-21 10:45:01 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-07-22 12:11:46 +0200 |
commit | 2a187a074a7f5ad9f01f72ac9715ddfcb2dbb8ec (patch) | |
tree | e2059f80134143e347f96e990a8527ed0af5f9e5 | |
parent | 93f16f338f9e8aba0c006752eb3afc3fe6e137fd (diff) | |
download | ffmpeg-2a187a074a7f5ad9f01f72ac9715ddfcb2dbb8ec.tar.gz |
asfdec: avoid crash in the case when chunk_len is 0 or pkt_len is 0
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavformat/asfdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 6a71be9ab2..6dc34d9735 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -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); |