Mercurial > libavcodec.hg
comparison utils.c @ 10505:e7f082df2d65 libavcodec
Add a NULL pointer check to avcodec_close() this should prevent a segfault
when closing without open.
author | michael |
---|---|
date | Tue, 10 Nov 2009 02:51:47 +0000 |
parents | bdf4a9ca162a |
children | 046dcf7aa19c |
comparison
equal
deleted
inserted
replaced
10504:9f16f997c41b | 10505:e7f082df2d65 |
---|---|
673 return -1; | 673 return -1; |
674 } | 674 } |
675 | 675 |
676 if (HAVE_THREADS && avctx->thread_opaque) | 676 if (HAVE_THREADS && avctx->thread_opaque) |
677 avcodec_thread_free(avctx); | 677 avcodec_thread_free(avctx); |
678 if (avctx->codec->close) | 678 if (avctx->codec && avctx->codec->close) |
679 avctx->codec->close(avctx); | 679 avctx->codec->close(avctx); |
680 avcodec_default_free_buffers(avctx); | 680 avcodec_default_free_buffers(avctx); |
681 av_freep(&avctx->priv_data); | 681 av_freep(&avctx->priv_data); |
682 avctx->codec = NULL; | 682 avctx->codec = NULL; |
683 entangled_thread_counter--; | 683 entangled_thread_counter--; |