[FFmpeg-cvslog] asfdec: avoid crash in the case when chunk_len is 0 or pkt_len is 0

Alexandra Hájková git at videolan.org
Wed Jul 22 17:22:41 CEST 2015


ffmpeg | branch: master | Alexandra Hájková <alexandra.khirnova at gmail.com> | Tue Jul 21 10:45:01 2015 +0200| [2a187a074a7f5ad9f01f72ac9715ddfcb2dbb8ec] | committer: Anton Khirnov

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

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a187a074a7f5ad9f01f72ac9715ddfcb2dbb8ec
---

 libavformat/asfdec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 6a71be9..6dc34d9 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);



More information about the ffmpeg-cvslog mailing list