cc_draw: ensure unsigned values

avoids possible signed integer overflow runtime errors
This commit is contained in:
2021-12-02 19:04:41 +01:00
parent 05aa223257
commit d0a8c7eafc

View File

@@ -908,12 +908,12 @@ int CCDraw::getYPos() const
int CCDraw::getHeight() const int CCDraw::getHeight() const
{ {
return height; return std::max(0, height);
} }
int CCDraw::getWidth() const int CCDraw::getWidth() const
{ {
return width; return std::max(0, width);
} }
void CCDraw::setDimensionsAll(const int& xpos, const int& ypos, const int& w, const int& h) void CCDraw::setDimensionsAll(const int& xpos, const int& ypos, const int& w, const int& h)