summaryrefslogtreecommitdiff
path: root/libavcodec/eacmv.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-29 08:26:03 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-30 02:57:06 +0200
commit3c7ca68eeb8f121988a2fe8f36b1bae10e0c3ea1 (patch)
tree29f2483543e1390c80b48f81dee05e4f2d4415ca /libavcodec/eacmv.c
parentfea984d5c7a4ca92c1132ff468905fa026233967 (diff)
downloadffmpeg-3c7ca68eeb8f121988a2fe8f36b1bae10e0c3ea1.tar.gz
avcodec/eacmv: Cleanup generically after init failure
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/eacmv.c')
-rw-r--r--libavcodec/eacmv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 6f39d72b88..b239acffda 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,
};