Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/webpimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ void WebPImage::inject_VP8X(BasicIo& iIo, bool has_xmp, bool has_exif, bool has_
data[6] = (w >> 16) & 0xFF;

/* set height - stored in 24bits */
Internal::enforce(width > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
Internal::enforce(height > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
uint32_t h = height - 1;
Comment on lines 772 to 774
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a regression/system test for this specific height==0 case (issue #9279). The repo already has WebP inject_VP8X regression coverage (e.g. tests/bugfixes/github/test_issue_2270.py), but there doesn't appear to be a test that exercises a malformed WebP leading to height==0 and verifies we fail with kerCorruptedMetadata rather than wrapping height-1.

Copilot uses AI. Check for mistakes.
data[7] = h & 0xFF;
data[8] = (h >> 8) & 0xFF;
Expand Down
Loading