Commit 5664a457 by Rudolf

Reset bit pos only if it was max

This allows custom use by moving the start of bit reading.
parent b1f0aff0
Showing with 2 additions and 1 deletions
...@@ -120,7 +120,8 @@ bb_read (struct BIT_BUFFER *buffer, int size) ...@@ -120,7 +120,8 @@ bb_read (struct BIT_BUFFER *buffer, int size)
if (!(fread (&(buffer->bits), sizeof (byte), 1, buffer->fp))) if (!(fread (&(buffer->bits), sizeof (byte), 1, buffer->fp)))
return NULL; return NULL;
buffer->first_read = 1; buffer->first_read = 1;
buffer->pos = 0; if (buffer->pos == BYTE_BIT)
buffer->pos = 0;
} }
shift_pos = BYTE_BIT - buffer->pos - 1; shift_pos = BYTE_BIT - buffer->pos - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment