cc_draw: avoid possible runtime error with signed integer overflow

Origin commit data
------------------
Branch: ni/coolstream
Commit: f2e4e8b9d7
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-11-13 (Sat, 13 Nov 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2021-11-13 12:26:36 +01:00
committed by vanhofen
parent b53ef18825
commit 6c57c0a39b

View File

@@ -121,11 +121,13 @@ bool CCDraw::applyDimChanges()
{
bool ret = false;
if (height != height_old){
height = std::max(0, height);
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], dim changes height %d != height_old %d...\033[0m\n", __func__, __LINE__, height, height_old);
height_old = height;
ret = true;
}
if (width != width_old){
width = std::max(0, width);
dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], dim changes width %d != width_old %d...\033[0m\n", __func__, __LINE__, width, width_old);
width_old = width;
ret = true;