Repository navigation
Conversation
… EXIF chunk A WebP image whose chunks are all well formed but which carries no EXIF chunk was reported as "Invalid WebP file", and exif_read_data() returned false. A JPEG without EXIF returns the FILE and COMPUTED sections instead. Treat a clean walk of the chunk list as a valid file without metadata and keep rejecting truncated or oversized chunks. Add a test covering files with and without an EXIF chunk, the optional Exif header, padding after odd sized chunks and malformed layouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes GH-25678. Targets PHP-8.6.
A WebP whose chunks are all well formed but which has no
EXIFchunk was reported as "Invalid WebP file" andexif_read_data()returned false. A JPEG without EXIF returnsFILEandCOMPUTED.exif_scan_WEBP_header()now returns true after a clean walk of the chunk list. Truncated chunks, chunks larger than the declared RIFF size and anEXIFchunk under 8 bytes are still rejected.ext/exif/tests/webp_chunk_layouts.phptbuilds its own fixtures. It fails on the untouched branch for the no-EXIF cases and for a RIFF size too small to reach theEXIFchunk, and passes with the change. It also covers EXIF after the image data, the optionalExif\0\0header, padding after an odd sized chunk, an oversized RIFF size, a truncated file and a tinyEXIFchunk, which already behaved correctly.ext/exifpasses 108 of 108 on a Linux x86-64 CLI build. I have not tested Windows.