Skip to content

webp: Improve valid_file to check the header for magic words#5266

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-webpvalid
Open

webp: Improve valid_file to check the header for magic words#5266
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-webpvalid

Conversation

@lgritz

@lgritz lgritz commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

This is MUCH faster than asking libwebp to open the file!

This is MUCH faster than asking libwebp to open the file!

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@jessey-git

jessey-git commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Here we are giving a 64byte header to WebpGetInfo to parse through. Is that so much slower than doing a 12byte read here? Is WebP going off the rails validating that 64bytes?

@lgritz

lgritz commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

I found at least some cases where this kept webp from going off the rails.

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

Successfully merging this pull request may close these issues.

2 participants