X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Feacmv.c;h=b239acffda0c85f5d7ffed104f0aeb1e73c65106;hb=930391e5988abe126d29c5e9b09fab459e0b8936;hp=6f39d72b88d61a0279150655d8aefb2c361c3aa8;hpb=4dc1f06f0c84ebbd8b26cd77679450903244a3e8;p=ffmpeg diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 6f39d72b88d..b239acffda0 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -50,11 +50,8 @@ static av_cold int cmv_decode_init(AVCodecContext *avctx){ s->last_frame = av_frame_alloc(); s->last2_frame = av_frame_alloc(); - if (!s->last_frame || !s->last2_frame) { - av_frame_free(&s->last_frame); - av_frame_free(&s->last2_frame); + if (!s->last_frame || !s->last2_frame) return AVERROR(ENOMEM); - } return 0; } @@ -243,4 +240,5 @@ AVCodec ff_eacmv_decoder = { .close = cmv_decode_end, .decode = cmv_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };