From 964ebc0f4c8581b4147a53fdf1bfd7005d91ee2f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 28 Feb 2013 21:07:31 -0600 Subject: gras: fix buffer stitch edge case issue #51 --- lib/gras_impl/input_buffer_queues.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp index d192a2e..0db5cb4 100644 --- a/lib/gras_impl/input_buffer_queues.hpp +++ b/lib/gras_impl/input_buffer_queues.hpp @@ -273,7 +273,9 @@ GRAS_FORCE_INLINE void InputBufferQueues::push(const size_t i, const SBuffer &bu { SBuffer &b1 = _queues[i][j]; SBuffer &b0 = _queues[i][j-1]; - if (b1.last == b0.get(b0.length)) + //can stitch when last is the end of the front pointer + //and the front also has a last (not accum buffer) + if (b1.last == b0.get(b0.length) and b0.last != 0) { const size_t bytes = b1.length; b0.length += bytes; -- cgit