memory: Fix buffer overflow when position == NUM_BUFFERS

This commit is contained in:
James Cowgill 2017-05-05 10:33:56 +01:00
parent 5fecfe0f42
commit 59c97cfee4
1 changed files with 1 additions and 1 deletions

View File

@ -1015,7 +1015,7 @@ void *blas_memory_alloc(int procpos){
mypos = WhereAmI();
position = mypos;
while (position > NUM_BUFFERS) position >>= 1;
while (position >= NUM_BUFFERS) position >>= 1;
do {
if (!memory[position].used && (memory[position].pos == mypos)) {