lavfi/deshake: fix crash in uninit()

Add NULL check on avctx before calling avcodec_close() on it.

Fix trac ticket #1472.
This commit is contained in:
Stefano Sabatini 2012-06-21 17:00:52 +02:00
parent f77fd34bc3
commit 1bb30d0295

View 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);
}