aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2013-09-03 22:25:17 +0200
committerClément Bœsch <u@pkh.me>2013-09-04 22:06:38 +0200
commit3e1f507f3e8f16b716aa115552d243b48ae809bd (patch)
treeab59fbca555d5cfb2b47f309a4ca0869c1d41e0a
parent36cd017acd9cac0e6695124c052a59fb1fc13145 (diff)
downloadffmpeg-3e1f507f3e8f16b716aa115552d243b48ae809bd.tar.gz
avcodec: make avcodec_close() more tolerant.
See previous commit.
-rw-r--r--doc/APIchanges3
-rw-r--r--libavcodec/utils.c7
-rw-r--r--libavcodec/version.h2
3 files changed, 10 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 12b9af4002..45965e9d09 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
+2013-xx-xx - xxxxxxx - lavc 55.31.101 - avcodec.h
+ avcodec_close() argument can be NULL.
+
2013-xx-xx - xxxxxxx - lavf 55.16.101 - avformat.h
avformat_close_input() argument can be NULL and point on NULL.
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;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index e65c021a49..f16db2aa5a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
#define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 31
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \