[FFmpeg-cvslog] ffmpeg: Fix minor memleak of input_tmp

Chiranjeevi Melam git at videolan.org
Fri Sep 2 01:10:55 CEST 2011


ffmpeg | branch: master | Chiranjeevi Melam <cmelam at rgbnetworks.com> | Fri Sep  2 00:16:19 2011 +0200| [e6ea4c715db18b078537b784200e96c594328e0d] | committer: Michael Niedermayer

ffmpeg: Fix minor memleak of input_tmp

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

 ffmpeg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 3104d6e..71a80d8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -232,6 +232,8 @@ static AVBitStreamFilterContext *video_bitstream_filters=NULL;
 static AVBitStreamFilterContext *audio_bitstream_filters=NULL;
 static AVBitStreamFilterContext *subtitle_bitstream_filters=NULL;
 
+static uint8_t *input_tmp= NULL;
+
 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
 
 typedef struct InputStream {
@@ -557,6 +559,8 @@ static int exit_program(int ret)
     avfilter_uninit();
 #endif
 
+    av_freep(&input_tmp);
+
     if (received_sigterm) {
         fprintf(stderr,
             "Received signal %d: terminating.\n",
@@ -840,7 +844,6 @@ need_realloc:
                         return;
                     ist->is_start=0;
                 }else{
-                    static uint8_t *input_tmp= NULL;
                     input_tmp= av_realloc(input_tmp, byte_delta + size);
 
                     if(byte_delta > allocated_for_size - size){



More information about the ffmpeg-cvslog mailing list