diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 75c201cd46313aa2095e1bc406c4b18e6f1b0e88..decbc0f1c549059594876eb138f6f5355b9da13f 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -153,6 +153,8 @@ static int open_stream(void *log, MovieStream *st)
         return AVERROR(EINVAL);
     }
 
+    st->st->codec->refcounted_frames = 1;
+
     if ((ret = avcodec_open2(st->st->codec, codec, NULL)) < 0) {
         av_log(log, AV_LOG_ERROR, "Failed to open codec\n");
         return ret;