rescale() crashes if given negative w / h values
fire-eggs opened this issue · comments
In YAIV, inadvertently trying to zoom below 0%. This caused negative w or h values being sent to fl_imgtk::rescale.
Resulted in a crash rather than the expected nullptr return.
Dear Kevin,
I'd seen this issue too late, sorry.
I will try to check that issue, anyway did you know rescale parameters are only "unsigned" ?
I think zero size may protect by this line.
Line 1888 in 51f162b
You mean below 0%, is it going to negative value as integer ?
Maybe you didn't check signed to unsigned value, it may be a reason of crash for too large image size.
Regards, Raph.
Maybe ... is it better if limit maximum size of resized ?
Like ... #define MAX_IMAGE_WH_SIZE 1024000 ?
I'd seen this issue too late, sorry.
Not a crisis, just informational. A flaw in my UI, incorrectly sending a signed int to the resize function.
Glad to see you're still about - hadn't heard from you for a while ...
New project almost reached to the end for now.
So I couldn't have make time for response for a while.
Thanks !
Need to overflow case to prevent failure case.