48a5e77
This is part of chub/cue with a few changes. The original is at https://github.com/vchimishuk/chub