[php-src] PR #25679: Fix GH-25678: exif_read_data() rejects valid WebP files without an EXIF chunk
| From: | AceMedia | Date: | Mon, 23 Nov 2026 16:39:39 +0000 |
| Subject: | [php-src] PR #25679: Fix GH-25678: exif_read_data() rejects valid WebP files without an EXIF chunk | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40930@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25679
Author: AceMedia
Fixes GH-25678. Targets PHP-8.6.
A WebP whose chunks are all well formed but which has no
EXIF chunk was reported as
"Invalid WebP file" and exif_read_data() returned false. A JPEG without EXIF
returns FILE and COMPUTED. 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 an EXIF chunk under 8 bytes are still rejected.
ext/exif/tests/webp_chunk_layouts.phpt builds its own fixtures. It fails on the
untouched branch for the no-EXIF cases and for a RIFF size too small to reach the EXIF
chunk, and passes with the change. It also covers EXIF after the image data, the optional
Exif\0\0 header, padding after an odd sized chunk, an oversized RIFF size, a truncated
file and a tiny EXIF chunk, which already behaved correctly.
ext/exif passes 108 of 108 on a Linux x86-64 CLI build. I have not tested Windows.
> Disclosure: I used an LLM to help investigate this, write the test and draft this description.
> I reviewed the change and the results myself.