summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-10 20:15:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-13 15:55:42 +0100
commitf0bdd538712d8ed34120ab2b7bd1409fcc99fb45 (patch)
treea16336e73c07030eb4bea818813a8790e73ec4b3 /libavformat/utils.c
parent30581c51e72a7a7ea1572c1c6039f6e4c590a55c (diff)
avformat/utils: Print verbose error message if stream count exceeds max_streams
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9e979a7c79..897352924d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4217,8 +4217,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
int i;
AVStream **streams;
- if (s->nb_streams >= FFMIN(s->max_streams, INT_MAX/sizeof(*streams)))
+ if (s->nb_streams >= FFMIN(s->max_streams, INT_MAX/sizeof(*streams))) {
+ if (s->max_streams < INT_MAX/sizeof(*streams))
+ av_log(s, AV_LOG_ERROR, "Number of streams exceeds max_streams parameter (%d), see the documentation if you wish to increase it\n", s->max_streams);
return NULL;
+ }
streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams));
if (!streams)
return NULL;