[FFmpeg-cvslog] r13906 - trunk/ffserver.c

bcoudurier subversion
Mon Jun 23 09:28:49 CEST 2008


Author: bcoudurier
Date: Mon Jun 23 09:28:49 2008
New Revision: 13906

Log:
10l, dont use ctx before being set, fix segv

Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	(original)
+++ trunk/ffserver.c	Mon Jun 23 09:28:49 2008
@@ -2162,7 +2162,6 @@ static int http_prepare_data(HTTPContext
                     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
                     } 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
                         /* 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);




More information about the ffmpeg-cvslog mailing list