Commit a289cc56 authored by Limin Wang's avatar Limin Wang Committed by Michael Niedermayer

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

Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9e0f3352
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment