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;
}
if (ret < 0)
return ret;
if (size > buf_end - buf - EA_PREAMBLE_SIZE)
- return -1;
+ return AVERROR_INVALIDDATA;
buf += size;
}
- if (av_image_check_size(s->width, s->height, 0, s->avctx))
- return -1;
+ if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
+ return ret;
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
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,
.close = cmv_decode_end,
.decode = cmv_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};