diff options
author | Peter Åstrand <astrand@cendio.se> | 2004-12-20 09:58:49 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2004-12-20 09:58:49 +0000 |
commit | 1b4b5689810bfb3d787673331936ab7cdda9cc4b (patch) | |
tree | 5512950ffd7d256a453d01203af35ef63ad8ccd0 | |
parent | aede8d72afcbadc02e9e3f7d4f0d8ed8b0c4cda1 (diff) | |
download | tigervnc-1b4b5689810bfb3d787673331936ab7cdda9cc4b.tar.gz tigervnc-1b4b5689810bfb3d787673331936ab7cdda9cc4b.zip |
ZlibInStream must be reset after use, or we will end up with
"Rectangle too big" crashes sooner or later. (A good testcase is to
run "/usr/X11R6/lib/xscreensaver/attraction -mode splines" over a slow
connection.)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@48 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | rfb/tightDecode.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rfb/tightDecode.h b/rfb/tightDecode.h index 02589c99..c707ea15 100644 --- a/rfb/tightDecode.h +++ b/rfb/tightDecode.h @@ -153,12 +153,13 @@ void TIGHT_DECODE (const Rect& r, rdr::InStream* is, // Determine if the data should be decompressed or just copied. int rowSize = (r.width() * bppp + 7) / 8; int dataSize = r.height() * rowSize; + int streamId = -1; rdr::InStream *input; if (dataSize < TIGHT_MIN_TO_COMPRESS) { input = is; } else { int length = is->readCompactLength(); - int streamId = comp_ctl & 0x03; + streamId = comp_ctl & 0x03; zis[streamId].setUnderlying(is, length); input = &zis[streamId]; } @@ -216,6 +217,10 @@ void TIGHT_DECODE (const Rect& r, rdr::InStream* is, } IMAGE_RECT(r, buf); + + if (streamId != -1) { + zis[streamId].reset(); + } } static bool |