1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/truemotion1: Cleanup generically after init failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-08-29 09:39:40 +02:00
parent c767af97f8
commit 9372eb00c8

View File

@ -491,10 +491,8 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
/* there is a vertical predictor for each pixel in a line; each vertical /* there is a vertical predictor for each pixel in a line; each vertical
* predictor is 0 to start with */ * predictor is 0 to start with */
av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int)); av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
if (!s->vert_pred) { if (!s->vert_pred)
av_frame_free(&s->frame);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
}
return 0; return 0;
} }
@ -922,4 +920,5 @@ AVCodec ff_truemotion1_decoder = {
.close = truemotion1_decode_end, .close = truemotion1_decode_end,
.decode = truemotion1_decode_frame, .decode = truemotion1_decode_frame,
.capabilities = AV_CODEC_CAP_DR1, .capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}; };