ref: 8893e530fcadb20deb18f790e45235532ab10b58
parent: fe40ddd99992902760ce765e33364a8f695e4d37
author: Timothy B. Terriberry <[email protected]>
date: Thu Dec 30 03:56:49 EST 2010
Fix the limits for CELT_SET_END_BAND_REQUEST. The valid bands range from [start,end) everywhere, with start<end. Therefore end should never be 0, and should be allowed to extend all the way to mode->nbEBands. This patch does _not_ enforce that start<end, and it does _not_ handle clearing oldBandE[] when the valid range changes, which are separate issues.
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -1367,7 +1367,7 @@
case CELT_SET_END_BAND_REQUEST:
{
celt_int32 value = va_arg(ap, celt_int32);
- if (value<0 || value>=st->mode->nbEBands)
+ if (value<1 || value>st->mode->nbEBands)
goto bad_arg;
st->end = value;
}