In other words: Set the FF_CODEC_CAP_INIT_CLEANUP flag.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
c->frame = av_mallocz(avctx->width * avctx->height);
c->prev_frame = av_mallocz(avctx->width * avctx->height);
- if (!c->frame || !c->prev_frame) {
- av_freep(&c->frame);
- av_freep(&c->prev_frame);
+ if (!c->frame || !c->prev_frame)
return AVERROR(ENOMEM);
- }
return 0;
}
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};