According to the latest ISO specification pdf, the byte align should
be according to the patch.
Tested the change with all the sample ALS files. This doesn't produce any bug.
From 7af5076eabc28a441ed90f920bf1a6a1e0855c3f Mon Sep 17 00:00:00 2001
From: Umair Khan <omerj...@gmail.com>
Date: Wed, 27 Apr 2016 09:04:18 +0530
Subject: [PATCH] avcodec/alsdec: Fix bitstream reading

Signed-off-by: Umair Khan <omerj...@gmail.com>
---
 libavcodec/alsdec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 1402b00..0967ea0 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -867,9 +867,6 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
                 *current_res++ = decode_rice(gb, s[sb]);
      }
 
-    if (!sconf->mc_coding || ctx->js_switch)
-        align_get_bits(gb);
-
     return 0;
 }
 
@@ -989,6 +986,7 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
 {
     int ret;
     GetBitContext *gb        = &ctx->gb;
+    ALSSpecificConfig *sconf = &ctx->sconf;
 
     *bd->shift_lsbs = 0;
     // read block type flag and read the samples accordingly
@@ -998,6 +996,9 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
         ret = read_const_block_data(ctx, bd);
     }
 
+    if (!sconf->mc_coding || ctx->js_switch)
+        align_get_bits(gb);
+
     return ret;
 }
 
-- 
2.7.4

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

Reply via email to