if ((bits->bytePtr<<3)+bits->bitPtr+nbBits>bits->nbBits) bits->overflow=1; if (bits->overflow) return 0;
unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits){   unsigned int d=0;   while(nbBits)   {      d<<=1;      d |= (bits->bytes[bits->bytePtr]>>(7-bits->bitPtr))&1;      bits->bitPtr++;      if (bits->bitPtr==8)      {         bits->bitPtr=0;         bits->bytePtr++;      }      nbBits--;   }   return d;}