X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Favuienc.c;h=db640bb5a990c96424f07076ebbbb74486c9ba1f;hp=700b8cbd4bb24207091a2e1a9e4c0e20f9ff9aa1;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/avuienc.c b/ffmpeg/libavcodec/avuienc.c index 700b8cb..db640bb 100644 --- a/ffmpeg/libavcodec/avuienc.c +++ b/ffmpeg/libavcodec/avuienc.c @@ -25,16 +25,10 @@ static av_cold int avui_encode_init(AVCodecContext *avctx) { - avctx->coded_frame = av_frame_alloc(); - if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) { av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n"); return AVERROR(EINVAL); } - if (!avctx->coded_frame) { - av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n"); - return AVERROR(ENOMEM); - } if (!(avctx->extradata = av_mallocz(24 + FF_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); avctx->extradata_size = 24; @@ -45,6 +39,11 @@ static av_cold int avui_encode_init(AVCodecContext *avctx) avctx->extradata[19] = 1; } + 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; }