In ffserver.c:build_feed_streams(), the streams pointer is only 
correctly reset before deallocation when there is no error.

This may cause ffserver to crash, because stream lives in static
memory, not the heap.

The patch duplicates the behaviour of the non-error case.
>From 00c9203f0349dbae6e701104d5a7f6c4e6fa0159 Mon Sep 17 00:00:00 2001
From: Gregor Riepl <onit...@gmail.com>
Date: Tue, 24 May 2016 15:17:22 +0200
Subject: [PATCH] ffserver: fixed deallocation bug in build_feed_streams

Signed-off-by: Gregor Riepl <onit...@gmail.com>
---
 ffserver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffserver.c b/ffserver.c
index b5bd8f8..1a27583 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3863,6 +3863,8 @@ drop:
             if (avformat_write_header(s, NULL) < 0) {
                 http_log("Container doesn't support the required parameters\n");
                 avio_closep(&s->pb);
+                s->streams = NULL;
+                s->nb_streams = 0;
                 avformat_free_context(s);
                 goto bail;
             }
-- 
2.7.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to