-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[subset] null substitutions in FeatureVariationRecord trips assert in assign_offset() #2310
Comments
Another way to see this problem is that |
Just a guess, we may need add push () and pop_discard () pair after snap() and revert (). |
should be fixed with #2315 |
That sounds like the real problem to me. |
I disagree with this. |
I think is obvious to me now. snap/revert only recycle full objects. We want snap to also remember number of links in current object and revert that as well. Is that what @blueshade7 you think as well? |
That seems a natural behavior of |
I'm actually not sure. If susbstitions is empty we should return false and those objects cleaned. Let me dig more. |
Okay I see. The record lives dangling links in the current object indeed because records are part of the parent. Making revert clean up is indeed one way. Let me think of implications / alternatives. |
Normally when a |
Okay yes I think I like to adjust snapshot/revert to revert links in current object as well. That fully clarifies the issue. |
Actually that's a very valid usecase and legal. See #2334 |
Probably. What I don't like about OT spec is that it sometimes says "offset may be NULL", then it must mean that the subtable may be legally omitted by being NULL. However in many cases it doesn't say including this one. Possible interpretations are:
Spec must be unambiguous. |
@blueshade7 anything to do here? |
I don't know; I noticed oss-fuzz/21560 has been "fixed" maybe by other means? We can't debug & verify its fix without a reproducible test case anyways. If it's not fixed, I imagine fuzzer should rediscover it for us.:shrug: |
This has indeed been fixed. |
Found this issue while investigating https://crbug.com/oss-fuzz/21560
While serializing
FeatureVariationRecord
with non-nullconditions
and nullsubstitutions
,subset()
adds links for conditions then fails because of nullsubstitutions
. As a recovery attempt, the code below callshb_serialize_t::revert()
to restore the serialize buffer, as the result the same address in the serialize buffer may be reused for another link to a condition in the nextFeatureVariation
.harfbuzz/src/hb-ot-layout-common.hh
Lines 245 to 251 in c8cc1e3
Multiple links at the same address eventually triggers an assert in
hb_serialize_t::assign_offset()
:harfbuzz/src/hb-serialize.hh
Lines 485 to 491 in c8cc1e3
I believe
FeatureVariationRecord::sanitize()
should reject nullsubstitutions
. Currently it calls the genericOffsetTo::sanitize()
which accepts null.The text was updated successfully, but these errors were encountered: