Re: [PATCH v2 2/4] media: venus: hfi_parser: avoid OOB access beyond payload word count
From: Bryan O'Donoghue
Date: Mon Dec 02 2024 - 10:21:36 EST
On 02/12/2024 13:24, Vikash Garodia wrote:
If you see, words_count is doing the role of remaining_size. In existing
implementation as well, we can move those increments per case to once per loop,
just that to avoid incrementing for default case.
Yes.
To me it seems
- A redundant step to have words_count
- That the functions themselves should return the amount of bytes
words += should increment by
- That you could do that words += outside of the switch instead of
at each case:
but to be clear the logic of incrementing the words looks right to me
now, I'm suggesting additional stylistic change.
---
bod