diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-23 07:28:49 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-23 07:28:49 +0000 |
commit | 3ab29d8e4f56636722af718571d673e798469cec (patch) | |
tree | 1c412985a0fcfea1164b7479caf1fc4d911dcdd8 /ffserver.c | |
parent | dc3a6a368ca4aa5de6a85759a4a4d6b8f105e3b6 (diff) | |
download | ffmpeg-3ab29d8e4f56636722af718571d673e798469cec.tar.gz |
10l, do not use ctx before being set, fix segv
Originally committed as revision 13906 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c index 8fcaba9968..cba4528592 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2162,7 +2162,6 @@ static int http_prepare_data(HTTPContext *c) AVStream *ist, *ost; send_it: ist = c->fmt_in->streams[source_index]; - ost = ctx->streams[pkt.stream_index]; /* specific handling for RTP: we use several output stream (one for each RTP connection). XXX: need more abstract handling */ @@ -2193,7 +2192,7 @@ static int http_prepare_data(HTTPContext *c) } else { ctx = &c->fmt_ctx; /* Fudge here */ - codec = ost->codec; + codec = ctx->streams[pkt.stream_index]->codec; } if (c->is_packetized) { @@ -2210,6 +2209,8 @@ static int http_prepare_data(HTTPContext *c) /* XXX: potential leak */ return -1; } + ost = ctx->streams[pkt.stream_index]; + c->fmt_ctx.pb->is_streamed = 1; if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, ist->time_base, ost->time_base); |