diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 554b30edbf..c0f47cb67e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1071,15 +1071,7 @@ void avcodec_get_frame_defaults(AVFrame *frame) AVFrame *avcodec_alloc_frame(void) { - AVFrame *frame = av_malloc(sizeof(AVFrame)); - - if (frame == NULL) - return NULL; - - frame->extended_data = NULL; - avcodec_get_frame_defaults(frame); - - return frame; + return av_frame_alloc(); } void avcodec_free_frame(AVFrame **frame)