X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Froqvideoenc.c;h=72fc2d75aef166e94f872cecb8e58365c9e63331;hb=c7074375724e85e889ddaff68d150c12a90b4300;hp=157719a4dc40f640cd7d4ce8ac3646340c22a276;hpb=bde7f5b135c772e0122fd5df616e6de46e157167;p=ffmpeg diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index 157719a4dc4..72fc2d75aef 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -979,7 +979,6 @@ static av_cold int roq_encode_end(AVCodecContext *avctx) av_frame_free(&enc->current_frame); av_frame_free(&enc->last_frame); - av_frame_free(&enc->avctx->coded_frame); av_freep(&enc->tmpData); av_freep(&enc->this_motion4); @@ -1020,8 +1019,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) enc->last_frame = av_frame_alloc(); enc->current_frame = av_frame_alloc(); - avctx->coded_frame = av_frame_alloc(); - if (!enc->last_frame || !enc->current_frame || !avctx->coded_frame) { + if (!enc->last_frame || !enc->current_frame) { roq_encode_end(avctx); return AVERROR(ENOMEM); } @@ -1092,7 +1090,7 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt, /* 138 bits max per 8x8 block + * 256 codebooks*(6 bytes 2x2 + 4 bytes 4x4) + 8 bytes frame header */ size = ((enc->width * enc->height / 64) * 138 + 7) / 8 + 256 * (6 + 4) + 8; - if ((ret = ff_alloc_packet2(avctx, pkt, size)) < 0) + if ((ret = ff_alloc_packet2(avctx, pkt, size, 0)) < 0) return ret; enc->out_buf = pkt->data;