From fc331e62a8cdc0ab36c3640c7b36f2737f6089bb Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Mar 2015 16:42:45 +0100 Subject: [PATCH] overrun() needs to return the available space --- tests/encperf.cxx | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.5