|
@@ -1069,10 +1069,14 @@ static void build_evenly_distributed_points(
|
|
|
struct dividers dividers)
|
|
|
{
|
|
|
struct gamma_pixel *p = points;
|
|
|
- struct gamma_pixel *p_last = p + numberof_points - 1;
|
|
|
+ struct gamma_pixel *p_last;
|
|
|
|
|
|
uint32_t i = 0;
|
|
|
|
|
|
+ // This function should not gets called with 0 as a parameter
|
|
|
+ ASSERT(numberof_points > 0);
|
|
|
+ p_last = p + numberof_points - 1;
|
|
|
+
|
|
|
do {
|
|
|
struct fixed31_32 value = dc_fixpt_from_fraction(i,
|
|
|
numberof_points - 1);
|
|
@@ -1083,7 +1087,7 @@ static void build_evenly_distributed_points(
|
|
|
|
|
|
++p;
|
|
|
++i;
|
|
|
- } while (i != numberof_points);
|
|
|
+ } while (i < numberof_points);
|
|
|
|
|
|
p->r = dc_fixpt_div(p_last->r, dividers.divider1);
|
|
|
p->g = dc_fixpt_div(p_last->g, dividers.divider1);
|