diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index acf5e73b6b82f6844bc661d51c95df6907fe137f..20841bcf58465a9f9b4bae4a3928866c5fa8a9b0 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -42,6 +42,7 @@
 #include <stdlib.h>
 
 #include "avcodec.h"
+#include "internal.h"
 #include "lcl.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem.h"
@@ -197,4 +198,6 @@ AVCodec ff_zlib_encoder = {
     .encode2        = encode_frame,
     .close          = encode_end,
     .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
+                      FF_CODEC_CAP_INIT_CLEANUP,
 };