if (mss4_init_vlcs(c)) {
av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
- mss4_free_vlcs(c);
return AVERROR(ENOMEM);
}
for (i = 0; i < 3; i++) {
c->prev_dc[i] = av_malloc_array(c->dc_stride[i], sizeof(**c->prev_dc));
if (!c->prev_dc[i]) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
- mss4_free_vlcs(c);
return AVERROR(ENOMEM);
}
}
c->pic = av_frame_alloc();
- if (!c->pic) {
- mss4_decode_end(avctx);
+ if (!c->pic)
return AVERROR(ENOMEM);
- }
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
.close = mss4_decode_end,
.decode = mss4_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};