Skip to content

Commit

Permalink
fix(ios): crash when offset is outside range #1201
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Jan 4, 2020
1 parent d5bddd5 commit a2ef51f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Utils/RCTConvert+RNSVG.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ + (CGGradientRef)RNSVGCGGradient:(id)json
colorsAndOffsets[colorIndex + 2] = b;
colorsAndOffsets[colorIndex + 3] = a;

colorsAndOffsets[offsetIndex + i] = offset;
colorsAndOffsets[offsetIndex + i] = fmax(0, fmin(offset, 1));
}

CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
Expand Down

0 comments on commit a2ef51f

Please sign in to comment.