diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2019-12-24 04:06:18 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-03-22 15:00:19 +0300 |
commit | a289cc564338e4278bad07dfaee74c6262bdab30 (patch) | |
tree | 7ff80e0193b0644c6e2f65dca6b2c72392d10ebd /libavcodec/decode.c | |
parent | 9e0f3352d1f37a739d98df4347a2b60a396a56fe (diff) |
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>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 07b64b387b..af6bb3f952 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -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, |