[FFmpeg-devel] [CRASH]

Etienne Buira etienne.buira.lists at free.fr
Tue Jun 7 23:08:29 CEST 2011


On Tue, Jun 07, 2011 at 10:16:51PM +0200, Michael Niedermayer wrote:
> On Tue, Jun 07, 2011 at 03:20:42PM +0200, Etienne Buira wrote:
> > On Tue, Jun 07, 2011 at 01:14:46PM +0100, JULIAN GARDNER wrote:
> > > 
> > > Since last nights git pull i have been getting a crash (see error dump at end) at then end of encoding with the following command line
> > > 
> > > ./ffmpeg -i Lie.avi -i Lie.srt -vcodec libx264 -scodec ass -f mpegts -y a.ts
> > > 
> > > But if i remove the "-vcodec libx264" everything works fine.
> > > #7  0x086d88a2 in av_free (arg=0x8e9e144) at libavutil/mem.c:152
> > > #8  av_freep (arg=0x8e9e144) at libavutil/mem.c:159
> > > #9  0x086d8b87 in av_opt_free (obj=0x400) at libavutil/opt.c:528
> > > #10 0x0806d9ee in avcodec_close (avctx=0x8e9d900) at libavcodec/utils.c:862
> > > #11 0x08088e71 in transcode (nb_output_files=<value optimized out>, input_files=<value optimized out>,
> > >     nb_input_files=<value optimized out>, stream_maps=0x0, nb_stream_maps=0, output_files=<value optimized out>) at ffmpeg.c:2893
> > > #12 0x08089f8c in main (argc=17, argv=0xbffff704) at ffmpeg.c:4663
> > > (gdb)
> > 
> > Please try attached patch.
> 
> locally applied, will push later

Actually, after looking at the whole tree, I found anoter case where it
can crash, cleaned up at two other places.
-------------- next part --------------
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index cf0eb43..8be0192 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -349,13 +349,6 @@ static av_cold void uninit(AVFilterContext *ctx)
     DrawTextContext *dtext = ctx->priv;
     int i;
 
-    av_freep(&dtext->fontfile);
-    av_freep(&dtext->text);
-    av_freep(&dtext->expanded_text);
-    av_freep(&dtext->fontcolor_string);
-    av_freep(&dtext->boxcolor_string);
-    av_freep(&dtext->positions);
-    av_freep(&dtext->shadowcolor_string);
     av_tree_enumerate(dtext->glyphs, NULL, NULL, glyph_enu_free);
     av_tree_destroy(dtext->glyphs);
     dtext->glyphs = 0;
diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
index 6c5c831..f4f9e07 100644
--- a/libavfilter/vsrc_movie.c
+++ b/libavfilter/vsrc_movie.c
@@ -189,7 +189,6 @@ static av_cold void uninit(AVFilterContext *ctx)
     MovieContext *movie = ctx->priv;
 
     av_free(movie->file_name);
-    av_free(movie->format_name);
     if (movie->codec_ctx)
         avcodec_close(movie->codec_ctx);
     if (movie->format_ctx)
diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index 789a4d1..61f366c 100644
--- a/libavformat/crypto.c
+++ b/libavformat/crypto.c
@@ -97,8 +97,8 @@ static int crypto_open(URLContext *h, const char *uri, int flags)
 
     return 0;
 err:
-    av_free(c->key);
-    av_free(c->iv);
+    av_freep(c->key);
+    av_freep(c->iv);
     return ret;
 }
 
@@ -156,9 +156,6 @@ static int crypto_close(URLContext *h)
     CryptoContext *c = h->priv_data;
     if (c->hd)
         ffurl_close(c->hd);
-    av_freep(&c->aes);
-    av_freep(&c->key);
-    av_freep(&c->iv);
     return 0;
 }
 


More information about the ffmpeg-devel mailing list