History

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

Limin Wang committed 6 years ago

Commit a289cc51 parent 9e0f3351 file · +2 −2Browse files

Unified · Split

libavcodec/decode.c+2−2
@@ -227,13 +227,13 @@ int ff_decode_bsfs_init(AVCodecContext *avctx) · 226 unmodified lines
227227 goto fail;
228228 }
229229 s->bsfs = tmp;
230− s->nb_bsfs++;
231230
232− ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs - 1]);
231+ ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs]);
233232 if (ret < 0) {
234233 av_freep(&bsf);
235234 goto fail;
236235 }
236+ s->nb_bsfs++;
237237
238238 if (s->nb_bsfs == 1) {
239239 /* We do not currently have an API for passing the input timebase into decoders,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t