[SCM] libav/experimental: librtmp: Don't free the temp url at the end of rtmp_open

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:03:43 UTC 2014


The following commit has been merged in the experimental branch:
commit 865461099e062de5a3a109c2a5be98004c11d8bd
Author: Martin Storsjö <martin at martin.st>
Date:   Fri Jul 4 22:13:39 2014 +0300

    librtmp: Don't free the temp url at the end of rtmp_open
    
    librtmp can keep pointers to this string internally, and may
    use them at shutdown as well.
    
    CC: libav-stable at libav.org
    Signed-off-by: Martin Storsjö <martin at martin.st>

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index aa5bd42..74e2c49 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -47,6 +47,7 @@ typedef struct LibRTMPContext {
     char *pageurl;
     char *client_buffer_time;
     int live;
+    char *temp_filename;
 } LibRTMPContext;
 
 static void rtmp_log(int level, const char *fmt, va_list args)
@@ -71,6 +72,7 @@ static int rtmp_close(URLContext *s)
     RTMP *r = &ctx->rtmp;
 
     RTMP_Close(r);
+    av_freep(&ctx->temp_filename);
     return 0;
 }
 
@@ -149,7 +151,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
             len += strlen(ctx->swfurl);
     }
 
-    if (!(filename = av_malloc(len)))
+    if (!(ctx->temp_filename = filename = av_malloc(len)))
         return AVERROR(ENOMEM);
 
     av_strlcpy(filename, s->filename, len);
@@ -229,10 +231,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
     }
 
     s->is_streamed = 1;
-    rc = 0;
+    return 0;
 fail:
-    if (filename != s->filename)
-        av_freep(&filename);
+    av_freep(&ctx->temp_filename);
     return rc;
 }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list