8000 heif: fails to parse iloc box with base offset size > 0 · Issue #47 · go4org/go4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

heif: fails to parse iloc box with base offset size > 0 #47

8000 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

Open
petercgrant opened this issue Jan 3, 2020 · 0 comments
Open

heif: fails to parse iloc box with base offset size > 0 #47

petercgrant opened this issue Jan 3, 2020 · 0 comments

Comments

@petercgrant
Copy link
petercgrant commented Jan 3, 2020

Parsing a heif file containing an item location box with a base offset size > 0 fails. For example, parsing https://github.com/nokiatech/heif/blob/gh-pages/content/image_sequences/bird_burst.heic results in an EOF. This is caused by the following logic in parseItemLocationBox:

		if br.ok() && ilb.baseOffsetSize > 0 {
			br.Discard(int(ilb.baseOffsetSize) / 8)
		}

From the spec:

base_offset_size is taken from the set {0, 4, 8} and indicates the length in bytes of the base_offset field.

br.Discard expects a number of bytes to discard, and it's being called as if base_offset_size is a number of bits. This can be fixed by removing the / 8 or by changing that block to this:

ent.BaseOffset, _ = br.readUintN(ilb.baseOffsetSize * 8)

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

No branches or pull requests

1 participant
0