diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 68a7888686f7717c3325b87a7f7dbd883f9bc129..284ffcc68872e8c75fa7eb87cc2d40723280be56 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2917,7 +2917,8 @@ attribute_deprecated void av_free_static(void);
  * @deprecated. Code which uses av_mallocz_static is broken/misdesigned
  * and should correctly use static arrays
  */
-attribute_deprecated void *av_mallocz_static(unsigned int size);
+attribute_deprecated av_malloc_attrib av_alloc_size(1)
+void *av_mallocz_static(unsigned int size);
 
 /**
  * Copy image 'src' to 'dst'.