1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

lavf/brstm: if the file lies about the last block's size, correct it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Rodger Combs 2015-06-23 12:35:35 -05:00 committed by Michael Niedermayer
parent f4be604f1c
commit 68f00fb40b

View File

@ -369,6 +369,15 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
size = b->last_block_used_bytes;
samples = b->last_block_samples;
skip = b->last_block_size - b->last_block_used_bytes;
if (samples < size * 14 / 8) {
uint32_t adjusted_size = samples / 14 * 8;
if (samples % 14)
adjusted_size += (samples % 14 + 1) / 2 + 1;
skip += size - adjusted_size;
size = adjusted_size;
}
} else if (b->current_block < b->block_count) {
size = b->block_size;
samples = b->samples_per_block;