summaryrefslogtreecommitdiffstats
path: root/tests/encperf.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-03-03 16:42:45 +0100
committerPierre Ossman <ossman@cendio.se>2015-03-03 16:42:45 +0100
commitfc331e62a8cdc0ab36c3640c7b36f2737f6089bb (patch)
tree41740bafdb6ad2186dce7ef2aa08622d3a28bad2 /tests/encperf.cxx
parent86475a684dd111fd3c0fbdf177fc6e7f01708045 (diff)
downloadtigervnc-fc331e62a8cdc0ab36c3640c7b36f2737f6089bb.tar.gz
tigervnc-fc331e62a8cdc0ab36c3640c7b36f2737f6089bb.zip
overrun() needs to return the available space
Diffstat (limited to 'tests/encperf.cxx')
-rw-r--r--tests/encperf.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/encperf.cxx b/tests/encperf.cxx
index 6b1119ab..06207381 100644
--- a/tests/encperf.cxx
+++ b/tests/encperf.cxx
@@ -158,6 +158,9 @@ void DummyOutStream::flush()
int DummyOutStream::overrun(int itemSize, int nItems)
{
flush();
+ if (itemSize * nItems > end - ptr)
+ nItems = (end - ptr) / itemSize;
+ return nItems;
}
CConn::CConn(const char *filename)