mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-13 08:34:47 +00:00
avcodec/vb: Cleanup generically after init failure
In other words: Set the FF_CODEC_CAP_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
657756c353
commit
b128344dfc
@ -262,11 +262,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
c->frame = av_mallocz(avctx->width * avctx->height);
|
c->frame = av_mallocz(avctx->width * avctx->height);
|
||||||
c->prev_frame = av_mallocz(avctx->width * avctx->height);
|
c->prev_frame = av_mallocz(avctx->width * avctx->height);
|
||||||
|
|
||||||
if (!c->frame || !c->prev_frame) {
|
if (!c->frame || !c->prev_frame)
|
||||||
av_freep(&c->frame);
|
|
||||||
av_freep(&c->prev_frame);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -291,4 +288,5 @@ AVCodec ff_vb_decoder = {
|
|||||||
.close = decode_end,
|
.close = decode_end,
|
||||||
.decode = decode_frame,
|
.decode = decode_frame,
|
||||||
.capabilities = AV_CODEC_CAP_DR1,
|
.capabilities = AV_CODEC_CAP_DR1,
|
||||||
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user