BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.73k stars 267 forks source link

Disallow all-zero-length Huffman tables #260

Closed lexaknyazev closed 1 year ago

lexaknyazev commented 3 years ago

huffman_decoding_table::init allowed code lengths like [0, 0], which should be invalid. Alternatively, if such inputs are valid this should be documented.

richgel999 commented 3 years ago

This change seems reasonable, but I want to review it deeper before accepting.

richgel999 commented 2 years ago

This interacts with this report: https://github.com/BinomialLLC/basis_universal/issues/263

I'll need to set aside a day to make sure this doesn't break anything. I'll keep this PR up on my desk.

lexaknyazev commented 2 years ago

Any updates?

richgel999 commented 1 year ago

OK, this change should be good. The encoder should never emit tables with no symbols. Regression test works.