RobotWebTools / depthcloud_encoder

Point Cloud Encoder for Web-Based Streaming
http://robotwebtools.org/
Other
15 stars 13 forks source link

Changed to explicit casting #4

Closed asisbot closed 9 years ago

asisbot commented 10 years ago

There is a possibility that an overflow happens in the equation (int) = (unsigned int) - (unsigned int). In my PC, 'top_bottom_corner = (480 - 512) / 2' became large positive value and skipped 'if (top_bottom_corner < 0)'. Then It causes segmentation fault. You may want to use explicit casting to avoid that.