diff --git a/celt/bands.c b/celt/bands.c
index 5320ffab07bf59d2e8451f235c649a65824a920c..6785e08e02e6f176e02ec3dc3e2cda1e1d647a9f 100644
--- a/celt/bands.c
+++ b/celt/bands.c
@@ -1450,7 +1450,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end,
    if (encode && resynth)
       lowband_scratch = _lowband_scratch;
    else
-      lowband_scratch = X_+M*eBands[m->nbEBands-1];
+      lowband_scratch = X_+M*eBands[m->effEBands-1];
    ALLOC(X_save, resynth_alloc, celt_norm);
    ALLOC(Y_save, resynth_alloc, celt_norm);
    ALLOC(X_save2, resynth_alloc, celt_norm);