Our current stack:
API->API_TO_HAL_translator->HAL
->HAL_TO_Implementation_translator->Implementation
For most APIs:
- API passes objectCount.
- HAL expects objectCount.
- Implementation expects objectCount.
For APIs like ScriptGroupCreate:
- API passes byteCount. And unfortunately, these APIs are part of
NDK, we could not make them also passing objectCount like others.
- HAL expects objectCount.
- Implementation expects byteCount.
So that both API_TO_HAL_translator and
HAL_TO_Implementation_translator should correctly convert input
objectCount/byteCount to byteCount/objectCount.
This CL only fixes the HAL_TO_Implementation_translator part,
whereas aosp/356395 fixes the API_TO_HAL_translator part. Both
parts were mistakenly using byteCount as objectCount, causing
potential out-of-bound access.
Bug: 36404879
Test: mm on angler
Change-Id: I28541a8926aeafece40e2a3f664bda67e26a34a2
(cherry picked from commit fd14e27b89)