hwc: Fix to avoid heap corruption

- Check for MAX_NUM_APP_LAYERS before updating yuv indices array.
- Fall back to GPU composition when number of app layers exceeds
  MAX_NUM_APP_LAYERS to avoid heap corruption.

Change-Id: Ieb91b705a0a5f50ce2f8829d1f1ee048d44b7d2e
5 files changed