-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit total size of image instead of width and height individually. #1204
Conversation
067eb55
to
ba9a6ff
Compare
Thank you, that makes sense.
|
d897445
to
dc5808d
Compare
Fixed (and added fuzzing input to corpus). The size check is now implemented in a central location so it doesn't need to be modified in lots of places if it needs to be changed in the future. Problem was caused by a fuzzing input that had width Line 610 in ddb541a
|
dc5808d
to
fdc1ef7
Compare
Fixes compiler errors like the following with clang-12: /path/to/libheif/libheif/api/libheif/heif.cc:1673:10: error: result of comparison of constant 4294967295 with expression of type 'uint16_t' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare] cp > std::numeric_limits<std::underlying_type<heif_color_primaries>::type>::max()) { ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /path/to/libheif/libheif/api/libheif/heif.cc:1714:10: error: result of comparison of constant 4294967295 with expression of type 'uint16_t' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare] tc > std::numeric_limits<std::underlying_type<heif_transfer_characteristics>::type>::max()) { ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /path/to/libheif/libheif/api/libheif/heif.cc:1751:10: error: result of comparison of constant 4294967295 with expression of type 'uint16_t' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare] mc > std::numeric_limits<std::underlying_type<heif_matrix_coefficients>::type>::max()) { ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated.
fdc1ef7
to
a31ffe6
Compare
Thank you |
This is required since PR strukturag/libheif#1204 (libheif 1.18.0), which limits the total image size instead of the width and height individually.
This is required since PR strukturag/libheif#1204 (libheif 1.18.0), which limits the total image size instead of the width and height individually.
This is required since PR strukturag/libheif#1204 (libheif 1.18.0), which limits the total image size instead of the width and height individually. (cherry picked from commit 9a3eb99)
This is required since PR strukturag/libheif#1204 (libheif 1.18.0), which limits the total image size instead of the width and height individually. (cherry picked from commit 9a3eb99)
This allows processing panorama images with could be more than 32k pixels wide but a lot less than 32k pixexls high (e.g. 40000 x 5000 pixels). This fits in the memory limit defined by the previous 32k x 32k pixels limit but would be rejected without this PR.