From 69c0c19ad2ecec833cf1fb06e187037b531e50dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 4 May 2013 00:13:11 +0200 Subject: [PATCH] Fixed off-by-one error in Buffer state tracking. I have no idea why there is one more value than needed. --- src/Buffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 4c2e18718..fc9eab000 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -101,8 +101,9 @@ Buffer::Target Buffer::bindInternal(Target hint) { if(hintBinding == _id) return hint; /* Return first target in which the buffer is bound */ + /** @todo wtf there is one more? */ for(std::size_t i = 1; i != Implementation::BufferState::TargetCount; ++i) - if(bindings[i] == _id) return Implementation::BufferState::targetForIndex[i]; + if(bindings[i] == _id) return Implementation::BufferState::targetForIndex[i-1]; /* Bind the buffer to hint target otherwise */ hintBinding = _id;