diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-11-10 12:23:06 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-11-10 12:23:06 +0100 |
commit | 7e8b8b10cd290d80954f6e2c57112f2eb3e2a251 (patch) | |
tree | cd00e674cacd2d893e9bb2cf0176b8cd16276d84 /common | |
parent | 05338bccb76e9019f51d1528631c3eecd36026ae (diff) | |
parent | 2a4734c66f73fb378654d379acad2328cfc9b152 (diff) | |
download | tigervnc-7e8b8b10cd290d80954f6e2c57112f2eb3e2a251.tar.gz tigervnc-7e8b8b10cd290d80954f6e2c57112f2eb3e2a251.zip |
Merge branch 'master' of https://github.com/atalax/tigervnc
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/hextileDecode.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/rfb/hextileDecode.h b/common/rfb/hextileDecode.h index 47006a04..402cd031 100644 --- a/common/rfb/hextileDecode.h +++ b/common/rfb/hextileDecode.h @@ -22,6 +22,7 @@ // BPP - 8, 16 or 32 #include <rdr/InStream.h> +#include <rfb/Exception.h> #include <rfb/hextileConstants.h> namespace rfb { @@ -87,6 +88,9 @@ static void HEXTILE_DECODE (const Rect& r, rdr::InStream* is, int y = (xy & 15); int w = ((wh >> 4) & 15) + 1; int h = (wh & 15) + 1; + if (x + w > 16 || y + h > 16) { + throw rfb::Exception("HEXTILE_DECODE: Hextile out of bounds"); + } PIXEL_T* ptr = buf + y * t.width() + x; int rowAdd = t.width() - w; while (h-- > 0) { |