|
|
@@ -3764,8 +3764,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; |
|
|
|