1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Fix groupLen[] size

It is zero-terminated array of group lengths, so in case
of 6-men, all different peices we have 6 groups and we need
size 7 to account for the zero-termination.
This commit is contained in:
Marco Costalba 2016-06-02 08:35:45 +02:00
parent 3077acaa2d
commit 02004b8e50

View file

@ -122,7 +122,7 @@ struct PairsData {
std::vector<uint8_t> symlen; // Number of values (-1) represented by a given Huffman symbol: 1..256
Piece pieces[TBPIECES]; // Sequence of the pieces: order is critical to ensure the best compression
uint64_t groupIdx[TBPIECES]; // Start index for the encoding of the group
uint8_t groupLen[TBPIECES]; // Number of pieces in a given group: KRKN -> (3, 1)
int groupLen[TBPIECES+1]; // Number of pieces in a given group: KRKN -> (3, 1)
};
// Helper struct to avoid to manually define entry copy c'tor as we should