Commit e5c01ccd authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flacdec: Call ff_flacdsp_init() unconditionally

Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 2ad38c6e
...@@ -472,10 +472,10 @@ static int decode_frame(FLACContext *s) ...@@ -472,10 +472,10 @@ static int decode_frame(FLACContext *s)
ret = allocate_buffers(s); ret = allocate_buffers(s);
if (ret < 0) if (ret < 0)
return ret; return ret;
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->channels, s->bps);
s->got_streaminfo = 1; s->got_streaminfo = 1;
dump_headers(s->avctx, (FLACStreaminfo *)s); dump_headers(s->avctx, (FLACStreaminfo *)s);
} }
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->channels, s->bps);
// dump_headers(s->avctx, (FLACStreaminfo *)s); // dump_headers(s->avctx, (FLACStreaminfo *)s);
......
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