summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-02-28 21:07:31 -0600
committerJosh Blum2013-02-28 21:07:31 -0600
commit964ebc0f4c8581b4147a53fdf1bfd7005d91ee2f (patch)
tree7f61e37435560774bf17af3acf7299f83f96398d /lib
parent2f2abb4102d442e88ea6b9a63c4c149943832eed (diff)
downloadsandhi-964ebc0f4c8581b4147a53fdf1bfd7005d91ee2f.tar.gz
sandhi-964ebc0f4c8581b4147a53fdf1bfd7005d91ee2f.tar.bz2
sandhi-964ebc0f4c8581b4147a53fdf1bfd7005d91ee2f.zip
gras: fix buffer stitch edge case issue #51
Diffstat (limited to 'lib')
-rw-r--r--lib/gras_impl/input_buffer_queues.hpp4
1 files changed, 3 insertions, 1 deletions
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;