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

avcodec/decode: increase nb_bsfs after av_bsf_alloc in case alloc failed

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Limin Wang 2019-12-24 09:06:18 +08:00 committed by Michael Niedermayer
parent 9e0f3352d1
commit a289cc5643

View File

@ -227,13 +227,13 @@ int ff_decode_bsfs_init(AVCodecContext *avctx)
goto fail;
}
s->bsfs = tmp;
s->nb_bsfs++;
ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs - 1]);
ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs]);
if (ret < 0) {
av_freep(&bsf);
goto fail;
}
s->nb_bsfs++;
if (s->nb_bsfs == 1) {
/* We do not currently have an API for passing the input timebase into decoders,