You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no validation for the input arguments to bitmap_target. Given that the underlying call unwraps instead of propagating error, the program could panic when input is invalid.
The program will panic if width == 0 and/or height == 0. I am wondering whether it makes sense to validate input arguments and return Error::InvalidInput if the validation fails before sending the request to backend.
The text was updated successfully, but these errors were encountered:
I agree it makes sense to have this return a Result; either we could validate ourselves or just wrap the inner error instead of unwrapping; I would prefer the latter unless there's a situation where we segfault (which macOS likes to do sometimes when you pass bad args) in which case validation would totally make sense.
will panic if width and/or height are 0. Hence I guess input validation, at least for mac, is needed.
Apart from that, should pix_scale be verified? I tried passing 0.0 and -1.0 and the call succeeded with no panic/error but I suspect there will be problem in later usage.
Currently there is no validation for the input arguments to
bitmap_target
. Given that the underlying call unwraps instead of propagating error, the program could panic when input is invalid.For example
https://github.com/linebender/piet/blob/master/piet-common/src/direct2d_back.rs#L108-L111
https://github.com/linebender/piet/blob/master/piet-common/src/cairo_back.rs#L81
The program will panic if
width == 0
and/orheight == 0
. I am wondering whether it makes sense to validate input arguments and returnError::InvalidInput
if the validation fails before sending the request to backend.The text was updated successfully, but these errors were encountered: