mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-25 08:10:41 +00:00
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>
(cherry picked from commit f0bdd53871
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3e3e095fc9
commit
9519b2560e
@ -4213,8 +4213,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
|
|||||||
int i;
|
int i;
|
||||||
AVStream **streams;
|
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;
|
return NULL;
|
||||||
|
}
|
||||||
streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams));
|
streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams));
|
||||||
if (!streams)
|
if (!streams)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user