bound create and raw input dimensions to coordinate limit#4558
Conversation
|
Thanks again for the PR. Happy to accept multiple fixes at once if known and it's easier. Given it's starting to appear in a few places, do you think it might be worth defining the |
|
I'll need to think a bit more about how we expose getting/setting the upstream coordinate limit so let's merge and release this useful fix, thanks again. |
|
Agreed, pulling the 100000000 into lib/utility.mjs makes sense, especially with a view to reading it back from libvips later so it stays in sync. Happy to put that follow-up together once you've settled on how you'd like the get/set exposed, so it can land in one go rather than piecemeal. |
Unbounded create and raw input dimensions
create.width/heightandraw.width/heightin_createInputDescriptorwere validated only as> 0, so a dimension above the libvips coordinate limit reaches thegintwidth/height property and is silently dropped: 100000001 leaves aGLib-GObject-CRITICALand a 1px fallback image, and 2147483648 narrows to a negative size. Bounded all four to 1-100000000 to match thetext.width/text.heightcheck already in the same function, so an oversized dimension now fails validation up front rather than producing a wrong-sized result. This also keeps the input-descriptor checks consistent with the other dimension options.