X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Feacmv.c;h=6c4a85214fb63ddaef3348bfc2ae7f4f70364974;hb=6ad61e30a16d338eab23b649365813fb150066ef;hp=6f39d72b88d61a0279150655d8aefb2c361c3aa8;hpb=d6b62ce1aced9e2456582870382f384581cc7cbb;p=ffmpeg diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 6f39d72b88d..6c4a85214fb 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; } @@ -233,7 +230,7 @@ static av_cold int cmv_decode_end(AVCodecContext *avctx){ return 0; } -AVCodec ff_eacmv_decoder = { +const AVCodec ff_eacmv_decoder = { .name = "eacmv", .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), .type = AVMEDIA_TYPE_VIDEO, @@ -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, };