fix SIGFPE in hwcomposer caused by modulo by zero

Change-Id: I36e798dc01a54340c8014a23be0081443b62ef70