git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@143
7c90b180-03d5-4157-b861-
58a559ae9d1e
int
bitstream_incrpos(bitstream_t *bs, signed long byte_incr,
- unsigned long bit_incr) {
+ signed long bit_incr) {
bs->byte_offset += byte_incr;
bs->bit_offset += bit_incr;
+ while (bs->bit_offset < 0) {
+ bs->bit_offset += 8;
+ bs->byte_offset --;
+ }
while (bs->bit_offset >= 8) {
bs->bit_offset -= 8;
bs->byte_offset ++;
/* seeking */
extern int bitstream_incrpos(bitstream_t *bs, signed long byte_incr,
- unsigned long bit_incr);
+ signed long bit_incr);
extern int bitstream_setpos(bitstream_t *bs, unsigned long byte_offset,
unsigned long bit_offset);
extern unsigned long bitstream_getbytepos(bitstream_t *bs);