Skip to content

Commit

Permalink
Overflow/Undeflow of Subtractive Function #5194 (#5221)
Browse files Browse the repository at this point in the history
  • Loading branch information
derwin12 authored Feb 19, 2025
1 parent 1beca45 commit be3db57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xLights/effects/ispc/LayerBlendingFunctions.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,9 @@ export void SubtractiveFunction(uniform const LayerBlendingData &data,
uint32 fg = src[index];
if (!data.isChromaKey || !applyChroma(data, fg)) {
uint32 bg = result[index];
int r = red(bg) - red(fg);
int g = green(bg) - green(fg);
int b = blue(bg) - blue(fg);
int r = (int)red(bg) - (int)red(fg);
int g = (int)green(bg) - (int)green(fg);
int b = (int)blue(bg) - (int)blue(fg);
if (r < 0)
r = 0;
if (g < 0)
Expand Down

0 comments on commit be3db57

Please sign in to comment.