From 02004b8e505ee813defb7877e3d36eb187654303 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 2 Jun 2016 08:35:45 +0200 Subject: [PATCH] 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. --- src/syzygy/tbprobe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 24293761..043fda01 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -122,7 +122,7 @@ struct PairsData { std::vector 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