ffserver_config: Setup codecpar in add_codec()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 29 Nov 2016 17:48:40 +0000 (18:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 7 Feb 2017 12:21:14 +0000 (13:21 +0100)
fixes segfault in the status page code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 472fee91bcf9b7bae81fd4c00bbe5151ca458a7c)

ffserver_config.c

index 0ec93b5..e0fc687 100644 (file)
@@ -323,6 +323,8 @@ done:
     av_dict_free(&recommended);
     av_stream_set_recommended_encoder_configuration(st, enc_config);
     st->codec = av;
+    st->codecpar = avcodec_parameters_alloc();
+    avcodec_parameters_from_context(st->codecpar, av);
     stream->streams[stream->nb_streams++] = st;
 }