[FFmpeg-cvslog] avserver: do not use a static string as a default for a string option

Anton Khirnov git at videolan.org
Tue Aug 6 09:19:28 CEST 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Aug  4 18:47:22 2013 +0200| [612a5049d9b4ac1c2a293daf75fe814b7a94fdc7] | committer: Anton Khirnov

avserver: do not use a static string as a default for a string option

Fixes an invalid free.

Bug-id: 448

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=612a5049d9b4ac1c2a293daf75fe814b7a94fdc7
---

 avserver.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/avserver.c b/avserver.c
index 560eda1..56bcda9 100644
--- a/avserver.c
+++ b/avserver.c
@@ -301,7 +301,7 @@ static int rtp_new_av_stream(HTTPContext *c,
 
 static const char *my_program_name;
 
-static const char *config_filename = "/etc/avserver.conf";
+static const char *config_filename;
 
 static int avserver_debug;
 static int no_launch;
@@ -4633,6 +4633,8 @@ int main(int argc, char **argv)
 {
     struct sigaction sigact = { { 0 } };
 
+    config_filename = av_strdup("/etc/avserver.conf");
+
     parse_loglevel(argc, argv, options);
     av_register_all();
     avformat_network_init();



More information about the ffmpeg-cvslog mailing list