@@ -470,10 +470,8 @@ static av_cold int init_buffers(SANMVideoContext *ctx)
&ctx->stored_frame_size, ctx->buf_size);
if (!ctx->frm0 || !ctx->frm1 || !ctx->frm2 ||
- (!ctx->stored_frame && !ctx->version)) {
- destroy_buffers(ctx);
+ (!ctx->stored_frame && !ctx->version))
return AVERROR(ENOMEM);
- }
return 0;
}
@@ -1525,5 +1523,5 @@ AVCodec ff_sanm_decoder = {
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavcodec/sanm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)