bs->cache&=DRFLAC_CACHE_L1_SELECTION_MASK(DRFLAC_CACHE_L1_SIZE_BITS(bs)-bs->consumedBits);// <-- Make sure the consumed bits are always set to zero. Other parts of the library depend on this property.
bs->cache&=DRFLAC_CACHE_L1_SELECTION_MASK(DRFLAC_CACHE_L1_BITS_REMAINING(bs));// <-- Make sure the consumed bits are always set to zero. Other parts of the library depend on this property.
bs->unalignedByteCount=0;// <-- At this point the unaligned bytes have been moved into the cache and we thus have no more unaligned bytes.
drflac_cache_tresultHi=bs->cache&riceParamMask;// <-- This mask is OK because all bits after the first bits are always zero.
drflac_cache_tresultHi=DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs,riceParam);// <-- Use DRFLAC_CACHE_L1_SELECT_AND_SHIFT_SAFE() if ever this function allows riceParam=0.
if((pRunningDataEnd-pRunningData)-4<(drflac_int64)metadata.data.vorbis_comment.vendorLength){// <-- Note the order of operations to avoid overflow to a valid value
// Need space for 'commentCount' comments after the block, which at minimum is a drflac_uint32 per comment
if((pRunningDataEnd-pRunningData)/sizeof(drflac_uint32)<metadata.data.vorbis_comment.commentCount){// <-- Note the order of operations to avoid overflow to a valid value
if((pRunningDataEnd-pRunningData)-24<(drflac_int64)metadata.data.picture.mimeLength){// <-- Note the order of operations to avoid overflow to a valid value
if((pRunningDataEnd-pRunningData)-20<(drflac_int64)metadata.data.picture.descriptionLength){// <-- Note the order of operations to avoid overflow to a valid value
if(pRunningDataEnd-pRunningData<(drflac_int64)metadata.data.picture.pictureDataSize){// <-- Note the order of operations to avoid overflow to a valid value