fix SIGFPE in hwcomposer caused by modulo by zero

Change-Id: I18c6b22fdefc96505a67e942875238a2c8216d5f