diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index 041482913fc9bd6b263bcb6bc674118950dd044d..137c8e65110687a448133b2accaaf40e741e11d7 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -23,7 +23,7 @@
 #include "libavutil/aarch64/neontest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
+                   const AVCodec *codec,
                    AVDictionary **options))
 {
     testneonclobbers(avcodec_open2, avctx, codec, options);
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index b77bcd72236949192edfc07b1a5ba07690cfbf87..692576ee45e50af9927665fc65cfb28ef24ddaa8 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -23,7 +23,7 @@
 #include "libavutil/arm/neontest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
+                   const AVCodec *codec,
                    AVDictionary **options))
 {
     testneonclobbers(avcodec_open2, avctx, codec, options);
diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 2f064cad7b661a09378a34ef4846d744b2be4929..400dc4df30182a86407b6fdb80bfd624a190572c 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -23,7 +23,7 @@
 #include "libavutil/x86/w64xmmtest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-                   AVCodec *codec,
+                   const AVCodec *codec,
                    AVDictionary **options))
 {
     testxmmclobbers(avcodec_open2, avctx, codec, options);