diff options
author | Mike William <mike@mikebwilliams.com> | 2011-05-21 04:50:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-21 04:50:59 +0200 |
commit | 840238b8706ea2ca740cf4b49bffd8ae196352f9 (patch) | |
tree | 7a3c65d1a04d379c25884455955463abf0fbd287 /ffserver.c | |
parent | ab1c19efc59cbcb1ff1b0c076cde01b87837f21e (diff) | |
download | ffmpeg-840238b8706ea2ca740cf4b49bffd8ae196352f9.tar.gz |
ffserver: dont just crash
With changes from ubitux.
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ffserver.c b/ffserver.c index 517cb6f3f3..4c2c5cf890 100644 --- a/ffserver.c +++ b/ffserver.c @@ -3386,6 +3386,9 @@ static int rtp_new_av_stream(HTTPContext *c, if (!st) goto fail; ctx->nb_streams = 1; + ctx->streams = av_mallocz(sizeof(*ctx->streams) * ctx->nb_streams); + if (!ctx->streams) + goto fail; ctx->streams[0] = st; if (!c->stream->feed || @@ -3766,11 +3769,7 @@ static void build_feed_streams(void) } s->oformat = feed->fmt; s->nb_streams = feed->nb_streams; - for(i=0;i<s->nb_streams;i++) { - AVStream *st; - st = feed->streams[i]; - s->streams[i] = st; - } + s->streams = feed->streams; av_set_parameters(s, NULL); if (av_write_header(s) < 0) { http_log("Container doesn't supports the required parameters\n"); |