Fix Issue 8301 - Access violation when a big array is allocated

Check that adding array padding doesn't cause overflow