Skip to content

Commit

Permalink
[BUGFIX] do not attempt dynamic table if it is not allocated (max_tab…
Browse files Browse the repository at this point in the history
…le_size < 32).
  • Loading branch information
gwanglst committed May 5, 2022
1 parent 520d30d commit d242522
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lsqpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ enc_free_hinfo (struct lsqpack_enc *enc, struct lsqpack_header_info *hinfo)
static int
enc_use_dynamic_table (const struct lsqpack_enc *enc)
{
return enc->qpe_cur_header.hinfo != NULL
return enc->qpe_max_entries > 0
&& enc->qpe_cur_header.hinfo != NULL
&& enc->qpe_cur_header.hinfo->qhi_bytes_inserted
< enc->qpe_cur_max_capacity / 2;
}
Expand Down

0 comments on commit d242522

Please sign in to comment.