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.
This commit is contained in:
Timothy B. Terriberry 2010-12-30 08:56:49 -08:00 committed by Jean-Marc Valin
parent fe40ddd999
commit 8893e530fc

View file

@ -1367,7 +1367,7 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
case CELT_SET_END_BAND_REQUEST: case CELT_SET_END_BAND_REQUEST:
{ {
celt_int32 value = va_arg(ap, celt_int32); 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; goto bad_arg;
st->end = value; st->end = value;
} }