summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-11-10 02:51:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-11-10 02:51:47 +0000
commitdccda293a0576d5414fafc0e95615c82a2f2399f (patch)
tree60a6c233d12e29360e8777b170b887ccc6c87fe5 /libavcodec/utils.c
parent7c4a001a3385c1872ee2c7fe6637ad4bb037c093 (diff)
Add a NULL pointer check to avcodec_close() this should prevent a segfault
when closing without open. Originally committed as revision 20495 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2f18848a9a..ddd11606dc 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -675,7 +675,7 @@ int avcodec_close(AVCodecContext *avctx)
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);