[subset] Fix UBSAN issue in sbix

This commit is contained in:
ckitagawa 2020-01-23 11:09:15 -05:00 committed by Ebrahim Byagowi
parent acb4627eba
commit 7dc341fe74
2 changed files with 3 additions and 2 deletions

View File

@ -337,12 +337,13 @@ struct sbix
const void *dst_base,
unsigned int i,
unsigned int sbix_len) const {
// Push first so reverting doesn't fail.
c->serializer->push ();
if (strikes[i].is_null () ||
sbix_len < (unsigned int) strikes[i])
return false;
c->serializer->push ();
return (this+strikes[i]).subset (c, sbix_len - (unsigned int) strikes[i]);
}