Fix use of wrong offset in buffer
The header of packing is a single byte and nothing was written to the first byte anyway.
This commit is contained in:
parent
24ec009d67
commit
a83769f44d
1 changed files with 4 additions and 4 deletions
|
|
@ -161,16 +161,16 @@ int capn_inflate(struct capn_stream* s) {
|
|||
continue;
|
||||
|
||||
default:
|
||||
hdr = s->next_in[0];
|
||||
sz = 0;
|
||||
hdr = s->next_in[1];
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (hdr & (1 << i))
|
||||
sz++;
|
||||
}
|
||||
if (s->avail_in < 2 + sz)
|
||||
if (s->avail_in < 1 + sz)
|
||||
return CAPN_NEED_MORE;
|
||||
|
||||
s->next_in += 2;
|
||||
s->next_in += 1;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (hdr & (1 << i)) {
|
||||
|
|
@ -181,7 +181,7 @@ int capn_inflate(struct capn_stream* s) {
|
|||
}
|
||||
|
||||
s->avail_out -= 8;
|
||||
s->avail_in -= 2 + sz;
|
||||
s->avail_in -= 1 + sz;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue