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

Question about WebPImage::inject_VP8X #2270

Closed
kevinbackhouse opened this issue Jul 6, 2022 · 2 comments · Fixed by #2348
Closed

Question about WebPImage::inject_VP8X #2270

kevinbackhouse opened this issue Jul 6, 2022 · 2 comments · Fixed by #2348
Assignees
Labels

Comments

@kevinbackhouse
Copy link
Collaborator

Does anybody here know why this -1 adjustment is needed in WebPImage::inject_VP8X?

int w = width - 1;

Most of the time, it looks like it's cancelling the corresponding +1 adjustments in WebPImage::doWriteMetadata, like this one:

width = Exiv2::getULong(size_buf, littleEndian) + 1;

But there's no +1 adjustment here:

width = Exiv2::getUShort(size_buf, littleEndian) & 0x3fff;

Which means that I can create a poc that causes w to be negative in WebPImage::inject_VP8X. Is that a bug? To run the poc:

exiv2 rm poc.webp

Nothing visibly bad happens. You need to set a breakpoint in WebPImage::inject_VP8X to see that w == -1.

@piponazo
Copy link
Collaborator

piponazo commented Jul 8, 2022

No idea from my side 😅

@kevinbackhouse kevinbackhouse self-assigned this Aug 4, 2022
@neheb
Copy link
Collaborator

neheb commented Aug 4, 2022

width being negative sounds like a bug 🤷

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

Successfully merging a pull request may close this issue.

3 participants