]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Add a NULL pointer check to avcodec_close() this should prevent a segfault
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 10 Nov 2009 02:51:47 +0000 (02:51 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 10 Nov 2009 02:51:47 +0000 (02:51 +0000)
when closing without open.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20495 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/utils.c

index 2f18848a9ac1840f421a895e215366c46e2ba3b9..ddd11606dc00d93db6bdde446be43fc167ee84a7 100644 (file)
@@ -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);