[FFmpeg-cvslog] r26176 - trunk/libavcodec/utils.c

aurel subversion
Fri Dec 31 01:06:25 CET 2010


Author: aurel
Date: Fri Dec 31 01:06:25 2010
New Revision: 26176

Log:
free subtitle_header before overwriting it to avoid memleak

Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Fri Dec 31 01:01:37 2010	(r26175)
+++ trunk/libavcodec/utils.c	Fri Dec 31 01:06:25 2010	(r26176)
@@ -505,6 +505,11 @@ int attribute_align_arg avcodec_open(AVC
         avcodec_set_dimensions(avctx, 0, 0);
     }
 
+    /* if the decoder init function was already called previously,
+       free the already allocated subtitle_header before overwriting it */
+    if (codec->decode)
+        av_freep(&avctx->subtitle_header);
+
 #define SANE_NB_CHANNELS 128U
     if (avctx->channels > SANE_NB_CHANNELS) {
         ret = AVERROR(EINVAL);



More information about the ffmpeg-cvslog mailing list