Limit entries to reasonable values. I entered 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as depth. While that yielded a result it is probably stupid. And the number wasn't large enough to cause some overflow, but that might happen depending on the calculations made. Pick reasonable maximum values for the fields and set the maxlength for the input field accordingly. For example, when a field accepts entries in percent and 100% is an unreasonable then set the maxlength to 2. That still allows for entering "-1" or "0" or "ab", but the amount of garbage you may have to deal with is cut down trememndously. Also, check some HTML5 guides, as far as I know there are now more means to restrict input. My expectation is that forcing only integer input will not generate any feedback when alpha characters are entered. While that fixes the problem it is bad UX. Rather accept the input and give feedback stating the entered value, that it is not accepted and why (such as "needs to be in range of 0-99 %"). Feedback of any kind makes always for better UX.
Well drat. in moving to '0' vice unset parameters tested with 'isset', I've broken a lot of the other calculations. This is probably the right direction to go, it just changes the priority of the tickets a little.
Added maxlength="5" to the inputs.
This should be resolved. Current values are tested against minimums and maximums.