aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-13 00:30:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-25 21:12:37 +0200
commit3038e2041e87ffd3d249ce0c8109f19207ca0017 (patch)
tree92f0231b9556fb063bd1babf013bb1a3d40580bf
parent8b64036038e259abd04d119b6f70df5433e4c04f (diff)
downloadffmpeg-3038e2041e87ffd3d249ce0c8109f19207ca0017.tar.gz
ffserver: prevent nb_streams from becoming too large
Fixes CID732249 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 0f46825d9833b70cec671d825b0065850c485196) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffserver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c
index 79463c0e64..aebe651617 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3457,6 +3457,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;
@@ -3802,6 +3805,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: