Index: celt/modes.c |
diff --git a/celt/modes.c b/celt/modes.c |
index ed204d7d9c4184a96c79af2ea9e3f4a888dd7ba2..42e68e1cb72f4350fc77b17148ad6235757403ca 100644 |
--- a/celt/modes.c |
+++ b/celt/modes.c |
@@ -345,6 +345,14 @@ CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error) |
mode->eBands = compute_ebands(Fs, mode->shortMdctSize, res, &mode->nbEBands); |
if (mode->eBands==NULL) |
goto failure; |
+#if !defined(SMALL_FOOTPRINT) |
+ /* Make sure we don't allocate a band larger than our PVQ table. |
+ 208 should be enough, but let's be paranoid. */ |
+ if ((mode->eBands[mode->nbEBands] - mode->eBands[mode->nbEBands-1])<<LM > |
+ 208) { |
+ goto failure; |
+ } |
+#endif |
mode->effEBands = mode->nbEBands; |
while (mode->eBands[mode->effEBands] > mode->shortMdctSize) |