coverity#735654 avoid division by 0

Change-Id: If368d300c5ed880e1359cbc67df0e13b00fc6ecf
coverity#735653 avoid division by 0

Change-Id: Ie3ec074292467f096e69142dc599b0e29e1e7f7b