Fixed MSVC static analyser warning about writing off the end of an array.