I think it is possible that you are writing past the end of the buffer array into memory that you do not "own". Maybe check that the value of the ind variable never gets to be greater than 24 (before incrementing).
I think it is possible that you are writing past the end of the buffer array into memory that you do not "own". Maybe check that the value of the ind variable never gets to be greater than 24 (before incrementing).