msm: vidc: Fix out of bound array access
With loop counter being declared as unsigned, it happens
to be that when none of the loop exit criteria is met,
the counter gets updated with a very high positive
value corresponding to unsigned -1. Due to this the
loop runs through and invalid memory is accessed. This
lead to unhandled page faults.
Declaring the loop counter as signed ensures that the
loop does not run beyond the intended iterations.
Change-Id: Ibe7b420f25fc2a6859655c76df8332663b903473
Signed-off-by:
Vikash Garodia <vgarodia@codeaurora.org>
Loading
Please register or sign in to comment