lavfi/deshake: fix crash in uninit()
authorStefano Sabatini <stefasab@gmail.com>
Thu, 21 Jun 2012 15:00:52 +0000 (17:00 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Thu, 21 Jun 2012 15:01:44 +0000 (17:01 +0200)
Add NULL check on avctx before calling avcodec_close() on it.

Fix trac ticket #1472.

libavfilter/vf_deshake.c

index 6b2a3d4..ff78f1f 100644 (file)
@@ -420,7 +420,8 @@ static av_cold void uninit(AVFilterContext *ctx)
     avfilter_unref_buffer(deshake->ref);
     if (deshake->fp)
         fclose(deshake->fp);
-    avcodec_close(deshake->avctx);
+    if (deshake->avctx)
+        avcodec_close(deshake->avctx);
     av_freep(&deshake->avctx);
 }