Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-06-23 20:35:35 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-06-27 15:15:12 +0300
commit68f00fb40bb3cfc354f6295e8a96b07600aa72a9 (patch)
treec6464f047ffd0b98bbe5e8b13993221b6d8a86b3 /libavformat/brstm.c
parentf4be604f1c4d5cb6480c81c671d646cc16b02017 (diff)
lavf/brstm: if the file lies about the last block's size, correct it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/brstm.c')
-rw-r--r--libavformat/brstm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index f5a4a82d4c..291a4628bc 100644
--- a/libavformat/brstm.c
+++ b/libavformat/brstm.c
@@ -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;