[FFmpeg-cvslog] lavf/asfenc: check the number of streams in header

Marton Balint git at videolan.org
Fri Feb 5 21:39:35 CET 2016


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Wed Feb  3 22:53:56 2016 +0100| [046476730102da3fe795176c9738e4db6bc7036f] | committer: Marton Balint

lavf/asfenc: check the number of streams in header

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavformat/asfenc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 9f082c6..6932c11 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -684,6 +684,11 @@ static int asf_write_header(AVFormatContext *s)
     s->max_interleave_delta = 0;
     asf->nb_packets = 0;
 
+    if (s->nb_streams > 127) {
+        av_log(s, AV_LOG_ERROR, "ASF can only handle 127 streams\n");
+        return AVERROR(EINVAL);
+    }
+
     asf->index_ptr             = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);
     if (!asf->index_ptr)
         return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list