alsdec: fix number of decoded samples in first sub-block in BGMC mode.
authorThilo Borgmann <thilo.borgmann@googlemail.com>
Sun, 15 Apr 2012 16:07:12 +0000 (18:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Apr 2012 18:20:37 +0000 (20:20 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/alsdec.c

index bae9df6..20ef407 100644 (file)
@@ -785,10 +785,10 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
             k    [sb] = s[sb] > b ? s[sb] - b : 0;
             delta[sb] = 5 - s[sb] + k[sb];
 
-            ff_bgmc_decode(gb, sb_length, current_res,
+            ff_bgmc_decode(gb, sb_length - i, current_res,
                         delta[sb], sx[sb], &high, &low, &value, ctx->bgmc_lut, ctx->bgmc_lut_status);
 
-            current_res += sb_length;
+            current_res += sb_length - i;
         }
 
         ff_bgmc_decode_end(gb);