[FFmpeg-cvslog] decimate: check for avctx ptr before closing.

Clément Bœsch git at videolan.org
Sun Mar 31 10:02:11 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Mar 31 10:00:32 2013 +0200| [29667a2c2014a54cf05f8106c45ad78be5228fd0] | committer: Clément Bœsch

decimate: check for avctx ptr before closing.

Fixes a crash init failed before setting avctx.

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

 libavfilter/vf_decimate.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 630f3ba..2410344 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -148,8 +148,10 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
     DecimateContext *decimate = ctx->priv;
     av_frame_free(&decimate->ref);
-    avcodec_close(decimate->avctx);
-    av_freep(&decimate->avctx);
+    if (decimate->avctx) {
+        avcodec_close(decimate->avctx);
+        av_freep(&decimate->avctx);
+    }
 }
 
 static int query_formats(AVFilterContext *ctx)



More information about the ffmpeg-cvslog mailing list