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

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/decode.c+2−2
@@ -227,13 +227,13 @@ int ff_decode_bsfs_init(AVCodecContext *avctx) · 226 unmodified lines
227 goto fail;227 goto fail;
228 }228 }
229 s->bsfs = tmp;229 s->bsfs = tmp;
230 s->nb_bsfs++;
231 230
232 ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs - 1]);231 ret = av_bsf_alloc(filter, &s->bsfs[s->nb_bsfs]);
233 if (ret < 0) {232 if (ret < 0) {
234 av_freep(&bsf);233 av_freep(&bsf);
235 goto fail;234 goto fail;
236 }235 }
236 s->nb_bsfs++;
237 237
238 if (s->nb_bsfs == 1) {238 if (s->nb_bsfs == 1) {
239 /* We do not currently have an API for passing the input timebase into decoders,239 /* 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