rbowler/spinhawk — pull request #8 by bpcvdhelm (2013-08-10 06:41:48+00:00)
Title: Possible incorrect CC1 in CMPSC.

CMPSC could return CC1 incorrectly, though it's never been reported.

The original test was if(bufferlength < 2 && enough bits). It was wrongly changed to if(bufferlength < 2 || enough bits). It is currently corrected to if(bufferlength < 3 && enough bits), saying a) no CC1 for bufferlengths longer than 2 bytes or b) no CC1 for bufferlength 1 or 2 bytes AND enough bits or c) CC1 for bufferlength 1 or 2 AND not enough bits.

The buffer could be occupied with cbn 7 and 13 bits symbol, occupying 7+13=20 bits and that is 3 bytes, not 2!

Please contact me for any trouble!