File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 11#![ forbid( unsafe_code) ]
2+ #![ deny( clippy:: cast_lossless) ]
23
34use core:: cmp:: Ordering ;
45use core:: ffi:: { c_int, c_uint} ;
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ mod stream {
254254 mut bit_buffer : u64 ,
255255 bits_used : i32 ,
256256 ) -> Option < ( u64 , i32 ) > {
257+ // we should only ask for more input if there are at least 8 free bits
258+ debug_assert ! ( bits_used <= 56 ) ;
259+
257260 if self . avail_in < 8 {
258261 return None ;
259262 }
@@ -289,6 +292,9 @@ mod stream {
289292 mut bit_buffer : u64 ,
290293 bits_used : i32 ,
291294 ) -> Option < ( u64 , i32 ) > {
295+ // we should only ask for more input if there are at least 8 free bits
296+ debug_assert ! ( bits_used <= 56 ) ;
297+
292298 if self . avail_in == 0 || bits_used > 56 {
293299 return None ;
294300 }
You can’t perform that action at this time.
0 commit comments