Commit cf6bb09
committed
Stop bgzf_index_dump_hfile() from writing invalid item counts
Adds `fp->idx->noffs > 0` checks before decrementing the item
count written to GZI indexes. Fixes a bug where the wrong
value was written when compressing and GZI indexing an empty
file. Note that since 6dd0d7d, files exhibiting this bug
will be rejected by bgzf_index_load_hfile().
Thanks to Matthieu Muffato for reporting this bug.1 parent acc28ac commit cf6bb09
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2399 | 2399 | | |
2400 | 2400 | | |
2401 | 2401 | | |
2402 | | - | |
| 2402 | + | |
2403 | 2403 | | |
2404 | 2404 | | |
2405 | | - | |
| 2405 | + | |
| 2406 | + | |
2406 | 2407 | | |
2407 | 2408 | | |
2408 | 2409 | | |
| |||
0 commit comments