mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/apac: stop adding samples if we run out of bits on EOF
This commit is contained in:
parent
1a7efafd33
commit
5d7f3b2639
|
@ -196,10 +196,14 @@ static int apac_decode(AVCodecContext *avctx, AVFrame *frame,
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_bits_left(gb) < c->block_length * c->bit_length && pkt->size) {
|
if (get_bits_left(gb) < c->block_length * c->bit_length) {
|
||||||
c->have_code = 1;
|
if (pkt->size) {
|
||||||
s->cur_ch = ch;
|
c->have_code = 1;
|
||||||
goto end;
|
s->cur_ch = ch;
|
||||||
|
goto end;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < c->block_length; i++) {
|
for (int i = 0; i < c->block_length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue