Top and left values of a bounding box can sometimes be negative in degenerate cases. For instance, if an object is very close to the border of the image, top value could be -1. This would cause integer overflow due to assignment of negative values to unsigned int.
The fix prevents the integer overflow in functions NvDsInferParseYoloV4 and NvDsInferParseYoloV5 by guaranteeing that top and left values are always nonnegative.
Top and left values of a bounding box can sometimes be negative in degenerate cases. For instance, if an object is very close to the border of the image, top value could be -1. This would cause integer overflow due to assignment of negative values to unsigned int. The fix prevents the integer overflow in functions NvDsInferParseYoloV4 and NvDsInferParseYoloV5 by guaranteeing that top and left values are always nonnegative.