From 3d55f87758d4c163046dbfd7d55c6f4180665d40 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 23 Apr 2005 16:07:34 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegenc.c: Don't crash if avcodec_open failed (#301717). Original commit message from CVS: Reviewed by: Ronald S. Bultje * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps): Don't crash if avcodec_open failed (#301717). --- ChangeLog | 7 +++++++ ext/ffmpeg/gstffmpegenc.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c1d9f3adf..f588aaa485 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-23 Luca Ognibene + + Reviewed by: Ronald S. Bultje + + * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps): + Don't crash if avcodec_open failed (#301717). + 2005-04-21 Ronald S. Bultje * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register): diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index 4e7c2b0fbb..cc815f1d0c 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -331,9 +331,8 @@ gst_ffmpegenc_getcaps (GstPad * pad) caps = gst_caps_new_empty (); gst_caps_append (caps, gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type, ctx)); + avcodec_close (ctx); } - /* FIXME: ffmpeg likes to crash on this */ - avcodec_close (ctx); } av_free (ctx);