Solved by ptrblck in post #2 
              
              
                temp_label seems to have the index value 58, while you are initializing label with 57 zeros. 
This would allow you to index label with values in [0, 56] and 58 will raise the out of bounds error.