From 472fee91bcf9b7bae81fd4c00bbe5151ca458a7c Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue, 29 Nov 2016 18:48:40 +0100
Subject: [PATCH] ffserver_config: Setup codecpar in add_codec()

fixes segfault in the status page code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 ffserver_config.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffserver_config.c b/ffserver_config.c
index 14c58cebb5e..2354cc7dc04 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -320,6 +320,8 @@ done:
     av_dict_free(&recommended);
     st->recommended_encoder_configuration = enc_config;
     st->codec = av;
+    st->codecpar = avcodec_parameters_alloc();
+    avcodec_parameters_from_context(st->codecpar, av);
     stream->streams[stream->nb_streams++] = st;
 }
 
-- 
GitLab