We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 28fc547 + d19ac45 commit 2734490Copy full SHA for 2734490
src/unigram_model_trainer.cc
@@ -273,7 +273,7 @@ TrainerModel::SentencePieces Trainer::MakeSeedSentencePiecesInternal() {
273
for (node_int_type i = 0; i < node_num; ++i) {
274
const node_int_type offset = SA[L[i]];
275
const node_int_type len = D[i];
276
- if (len <= 1) {
+ if (len <= 1 || offset >= array.size() || offset + len >= array.size()) {
277
continue;
278
}
279
const char32 *begin = &array[offset];
0 commit comments