Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2013-09-04 00:25:17 +0400
committerClément Bœsch <u@pkh.me>2013-09-05 00:06:38 +0400
commit3e1f507f3e8f16b716aa115552d243b48ae809bd (patch)
treeab59fbca555d5cfb2b47f309a4ca0869c1d41e0a /libavcodec/utils.c
parent36cd017acd9cac0e6695124c052a59fb1fc13145 (diff)
avcodec: make avcodec_close() more tolerant.
See previous commit.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 497cf15e10..30bc5222da 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2398,7 +2398,12 @@ av_cold int ff_codec_close_recursive(AVCodecContext *avctx)
av_cold int avcodec_close(AVCodecContext *avctx)
{
- int ret = ff_lock_avcodec(avctx);
+ int ret;
+
+ if (!avctx)
+ return 0;
+
+ ret = ff_lock_avcodec(avctx);
if (ret < 0)
return ret;