We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8f7418 commit d19ac45Copy full SHA for d19ac45
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