Browse code

Revert "ffserver: use AVStream.codecpar in open_input_stream()"

Fixes null pointer dereference

Testcase is simply a ffmpeg instance sending a stream to ffserver while another ffmpeg reads from it

This reverts commit 6f0a1710d77dde0d803861506a2157a23f08c14c.

Michael Niedermayer authored on 2016/11/24 03:26:38
Showing 1 changed files
... ...
@@ -2213,7 +2213,7 @@ static int open_input_stream(HTTPContext *c, const char *info)
2213 2213
     c->pts_stream_index = 0;
2214 2214
     for(i=0;i<c->stream->nb_streams;i++) {
2215 2215
         if (c->pts_stream_index == 0 &&
2216
-            c->stream->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
2216
+            c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
2217 2217
             c->pts_stream_index = i;
2218 2218
         }
2219 2219
     }