summaryrefslogtreecommitdiff
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorAlexandra Hájková <alexandra.khirnova@gmail.com>2015-07-21 10:45:01 +0200
committerAnton Khirnov <anton@khirnov.net>2015-07-22 12:11:46 +0200
commit2a187a074a7f5ad9f01f72ac9715ddfcb2dbb8ec (patch)
treee2059f80134143e347f96e990a8527ed0af5f9e5 /libavformat/asfdec.c
parent93f16f338f9e8aba0c006752eb3afc3fe6e137fd (diff)
asfdec: avoid crash in the case when chunk_len is 0 or pkt_len is 0
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c2
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);