X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fyuv4enc.c;h=17c670f40694d8646f089943a0a0328e4e073893;hb=f01e3c5d000d264b2935e186594a37a3c00f9465;hp=5ce48467d194d1915129a3754eaad1ce786ae229;hpb=9ebe041e1ca898ed725051460961f1fda5f7a20b;p=ffmpeg diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c index 5ce48467d19..17c670f4069 100644 --- a/libavcodec/yuv4enc.c +++ b/libavcodec/yuv4enc.c @@ -25,13 +25,6 @@ static av_cold int yuv4_encode_init(AVCodecContext *avctx) { - avctx->coded_frame = av_frame_alloc(); - - if (!avctx->coded_frame) { - av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n"); - return AVERROR(ENOMEM); - } - return 0; } @@ -42,7 +35,7 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t *y, *u, *v; int i, j, ret; - if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1))) < 0) + if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1), 0)) < 0) return ret; dst = pkt->data; @@ -74,8 +67,6 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static av_cold int yuv4_encode_close(AVCodecContext *avctx) { - av_frame_free(&avctx->coded_frame); - return 0; }