diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 044413a50a19006899d5f1ab20785ea9f5a28fc9..46f339fafde7b7d37a6fe46771b1d7a5023692f6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -853,7 +853,9 @@ AVFrame *avcodec_alloc_frame(void)
     if (frame == NULL)
         return NULL;
 
+FF_DISABLE_DEPRECATION_WARNINGS
     avcodec_get_frame_defaults(frame);
+FF_ENABLE_DEPRECATION_WARNINGS
 
     return frame;
 }