[PATCH v3 1/2] server: prevent division by zero in coordinate mapping