diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-07-25 20:44:32 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-07-25 20:44:32 +0200 |
commit | f81148c43a25d4c69e635b6ad13eab674b473aca (patch) | |
tree | 608c1605e931b1fe2456ec7c236aec3c18207fbc /common/rfb/EncodeManager.cxx | |
parent | d3a3fd692f9ee83164590338118034422308579c (diff) | |
download | tigervnc-f81148c43a25d4c69e635b6ad13eab674b473aca.tar.gz tigervnc-f81148c43a25d4c69e635b6ad13eab674b473aca.zip |
Avoid integer overflows in pixel size calculations
Diffstat (limited to 'common/rfb/EncodeManager.cxx')
-rw-r--r-- | common/rfb/EncodeManager.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx index 0ce611e9..53e0365d 100644 --- a/common/rfb/EncodeManager.cxx +++ b/common/rfb/EncodeManager.cxx @@ -519,7 +519,7 @@ Encoder *EncodeManager::startRect(const Rect& rect, int type) stats[klass][activeType].rects++; stats[klass][activeType].pixels += rect.area(); - equiv = 12 + rect.area() * conn->cp.pf().bpp/8; + equiv = 12 + rect.area() * (conn->cp.pf().bpp/8); stats[klass][activeType].equivalent += equiv; encoder = encoders[klass]; @@ -561,7 +561,7 @@ void EncodeManager::writeCopyRects(const Region& copied, const Point& delta) copyStats.rects++; copyStats.pixels += rect->area(); - equiv = 12 + rect->area() * conn->cp.pf().bpp/8; + equiv = 12 + rect->area() * (conn->cp.pf().bpp/8); copyStats.equivalent += equiv; conn->writer()->writeCopyRect(*rect, rect->tl.x - delta.x, |