mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 02:20:07 +01:00
10l, do not use ctx before being set, fix segv
Originally committed as revision 13906 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -2162,7 +2162,6 @@ static int http_prepare_data(HTTPContext *c)
|
|||||||
AVStream *ist, *ost;
|
AVStream *ist, *ost;
|
||||||
send_it:
|
send_it:
|
||||||
ist = c->fmt_in->streams[source_index];
|
ist = c->fmt_in->streams[source_index];
|
||||||
ost = ctx->streams[pkt.stream_index];
|
|
||||||
/* specific handling for RTP: we use several
|
/* specific handling for RTP: we use several
|
||||||
output stream (one for each RTP
|
output stream (one for each RTP
|
||||||
connection). XXX: need more abstract handling */
|
connection). XXX: need more abstract handling */
|
||||||
@@ -2193,7 +2192,7 @@ static int http_prepare_data(HTTPContext *c)
|
|||||||
} else {
|
} else {
|
||||||
ctx = &c->fmt_ctx;
|
ctx = &c->fmt_ctx;
|
||||||
/* Fudge here */
|
/* Fudge here */
|
||||||
codec = ost->codec;
|
codec = ctx->streams[pkt.stream_index]->codec;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->is_packetized) {
|
if (c->is_packetized) {
|
||||||
@@ -2210,6 +2209,8 @@ static int http_prepare_data(HTTPContext *c)
|
|||||||
/* XXX: potential leak */
|
/* XXX: potential leak */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
ost = ctx->streams[pkt.stream_index];
|
||||||
|
|
||||||
c->fmt_ctx.pb->is_streamed = 1;
|
c->fmt_ctx.pb->is_streamed = 1;
|
||||||
if (pkt.dts != AV_NOPTS_VALUE)
|
if (pkt.dts != AV_NOPTS_VALUE)
|
||||||
pkt.dts = av_rescale_q(pkt.dts, ist->time_base, ost->time_base);
|
pkt.dts = av_rescale_q(pkt.dts, ist->time_base, ost->time_base);
|
||||||
|
|||||||
Reference in New Issue
Block a user