Skip to content
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

Equally named subtypes are not resolved properly #105

Open
generalmimon opened this issue Mar 5, 2020 · 0 comments
Open

Equally named subtypes are not resolved properly #105

generalmimon opened this issue Mar 5, 2020 · 0 comments
Labels

Comments

@generalmimon
Copy link
Member

generalmimon commented Mar 5, 2020

I picked format jpeg.ksy from the format gallery in the devel Web IDE, loaded this JPG sample and the parsing ended up with this:

[Worker] Error TypeError: Cannot read property 'samplingX' of undefined
    at exportValue (kaitaiWorker.js:69)
    at kaitaiWorker.js:54
    at Array.map (<anonymous>)
    at exportValue (kaitaiWorker.js:54)
    at kaitaiWorker.js:65
    at Array.forEach (<anonymous>)
    at exportValue (kaitaiWorker.js:65)
    at kaitaiWorker.js:65
    at Array.forEach (<anonymous>)
    at exportValue (kaitaiWorker.js:65)

I did some digging and found that the problem is related to two subtypes with the same name component but contained in different types. The types are apparently accessed just by the name, not by path (kaitaiWorker.js:64 is handling this), so it finds types/segment_sos/types/component instead of the correct types/segment_sof0/types/component. And then it tries to access property sampling_x, which is present only in types/segment_sof0/types/component/instances/sampling_x and not in the other component, so it ends with an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant