# HG changeset patch # User michael # Date 1257821507 0 # Node ID e7f082df2d6523d7da5fd0340eb7aa0eff1f1ee8 # Parent 9f16f997c41b8a7f190a1559148037af0bde9472 Add a NULL pointer check to avcodec_close() this should prevent a segfault when closing without open. diff -r 9f16f997c41b -r e7f082df2d65 utils.c --- a/utils.c Mon Nov 09 22:10:43 2009 +0000 +++ b/utils.c Tue Nov 10 02:51:47 2009 +0000 @@ -675,7 +675,7 @@ if (HAVE_THREADS && avctx->thread_opaque) avcodec_thread_free(avctx); - if (avctx->codec->close) + if (avctx->codec && avctx->codec->close) avctx->codec->close(avctx); avcodec_default_free_buffers(avctx); av_freep(&avctx->priv_data);