Skip to content

Commit 0dde72e

Browse files
committed
Fix copy-paste error in WebPImage::inject_VP8X height check
Line 773 checks width > 0 instead of height > 0. This was introduced in commit bf151a1. When height is 0, the enforce does not catch it and height - 1 wraps as an unsigned integer. Change the check to validate height instead of width.
1 parent f9efd0e commit 0dde72e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webpimage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ void WebPImage::inject_VP8X(BasicIo& iIo, bool has_xmp, bool has_exif, bool has_
770770
data[6] = (w >> 16) & 0xFF;
771771

772772
/* set height - stored in 24bits */
773-
Internal::enforce(width > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
773+
Internal::enforce(height > 0, Exiv2::ErrorCode::kerCorruptedMetadata);
774774
uint32_t h = height - 1;
775775
data[7] = h & 0xFF;
776776
data[8] = (h >> 8) & 0xFF;

0 commit comments

Comments
 (0)