Commit 5f305228 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/flacdec: fix off by 1 error

Fixes assertion failure
Fixes: signal_sigsegv_324b284_1980_dilvie___the_dragonfly.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e5c01ccd
......@@ -366,7 +366,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
if (get_bits1(&s->gb)) {
int left = get_bits_left(&s->gb);
if ( left < 0 ||
if ( left <= 0 ||
(left < bps && !show_bits_long(&s->gb, left)) ||
!show_bits_long(&s->gb, bps)) {
av_log(s->avctx, AV_LOG_ERROR,
......
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