mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
avcodec/mpc8: Correct end truncation
Fixes Ticket5478 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b21f674876badefc68e4deecdb4a1d46de10b67c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ed7fe48445
commit
40ffbe7678
@ -415,10 +415,14 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
|
||||
c->cur_frame++;
|
||||
|
||||
c->last_bits_used = get_bits_count(gb);
|
||||
if(get_bits_left(gb) < 8) // we have only padding left
|
||||
c->last_bits_used = buf_size << 3;
|
||||
if(c->cur_frame >= c->frames)
|
||||
c->cur_frame = 0;
|
||||
if(c->cur_frame == 0 && get_bits_left(gb) < 8) {// we have only padding left
|
||||
c->last_bits_used = buf_size << 3;
|
||||
} else if (get_bits_left(gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
|
||||
c->last_bits_used = buf_size << 3;
|
||||
}
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user