diff --git a/doc/APIchanges b/doc/APIchanges
index 12b9af40020a25f3d944f0c0c9cf78e9a30dc791..45965e9d09b12d5ec74fad2f535f261cc8a10f2c 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 497cf15e10ec623fee3c832b2c75e7f3f1a8329f..30bc5222da287260ae69d94cf538e733674efb4e 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 e65c021a49a4fb9c2289363d9ce0bf4d0d1ad13e..f16db2aa5a961f109a491fbd21805377005744e0 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, \