changeset 202:a8b35f4c63b9 src

Minor bugfix for getbits. It did not actually change how in functioned, but it will have effected get16bits and get32bits future functions.
author jcdutton
date Sun, 18 May 2003 18:03:29 +0000
parents 534f17c79e4a
children 719d007d0639
files nav_read.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nav_read.c	Fri May 16 10:17:11 2003 +0000
+++ b/nav_read.c	Sun May 18 18:03:29 2003 +0000
@@ -69,6 +69,11 @@
       byte = byte >> (8 - number_of_bits);
       result = byte;
       state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */
+      if (state->bit_position == 8) {
+        state->bit_position = 0;
+        state->byte_position++;
+        state->byte = state->start[state->byte_position];
+      }
       number_of_bits = 0;
     }
   }