Initialize buffer index
Merge pull request #2 from ice799/fix_uninitialized_index

Initialize buffer index