Commit 0f46825d authored by Michael Niedermayer's avatar Michael Niedermayer

ffserver: prevent nb_streams from becoming too large

Fixes CID732249
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c2340831
......@@ -3474,6 +3474,9 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop
{
AVStream *fst;
if(stream->nb_streams >= FF_ARRAY_ELEMS(stream->streams))
return NULL;
fst = av_mallocz(sizeof(AVStream));
if (!fst)
return NULL;
......@@ -3821,6 +3824,9 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
{
AVStream *st;
if(stream->nb_streams >= FF_ARRAY_ELEMS(stream->streams))
return NULL;
/* compute default parameters */
switch(av->codec_type) {
case AVMEDIA_TYPE_AUDIO:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment