diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-13 00:30:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-13 00:31:21 +0200 |
commit | 0f46825d9833b70cec671d825b0065850c485196 (patch) | |
tree | b27fc36cc18892def614aba0638a9ada123b0570 /ffserver.c | |
parent | c2340831b8e9032716acb0aab4893d3cc500213a (diff) | |
download | ffmpeg-0f46825d9833b70cec671d825b0065850c485196.tar.gz |
ffserver: prevent nb_streams from becoming too large
Fixes CID732249
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c index cb7e3aeda3..955c326b8c 100644 --- a/ffserver.c +++ b/ffserver.c @@ -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: |