Commit 3c7ca68e authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/eacmv: Cleanup generically after init failure

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent fea984d5
......@@ -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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment