Re: [FFmpeg-devel] [PATCH 3/4] lavf/brstm: if the file lies about the last block's size, correct it

2015-06-27 Thread Michael Niedermayer
On Tue, Jun 23, 2015 at 12:35:35PM -0500, Rodger Combs wrote:
 ---
  libavformat/brstm.c | 9 +
  1 file changed, 9 insertions(+)

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/4] lavf/brstm: if the file lies about the last block's size, correct it

2015-06-23 Thread Rodger Combs
---
 libavformat/brstm.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index 62940f0..bf75d5b 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;
-- 
2.4.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel