Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 7d9e876

Browse files
committed
MCGContextRenderEffect(): Ensure pointers are initialised
Ensure that `t_mask_ptr` is always initialised. Initialise `t_shape_ptr` and `t_blur_ptr` at the point of acquisition.
1 parent 996c253 commit 7d9e876

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libgraphics/src/context.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,11 +1078,11 @@ static void MCGContextRenderEffect(MCGContextRef self, const SkMask& p_mask, MCG
10781078
t_tmp_mask . fRowBytes = p_mask . fRowBytes;
10791079
t_tmp_mask . fImage = SkMask::AllocImage(p_mask . computeImageSize());
10801080

1081-
uint8_t *t_blur_ptr, *t_mask_ptr, *t_shape_ptr;
1082-
t_shape_ptr = p_mask . fImage;
1083-
t_shape_ptr -= p_mask . fBounds . left();
1084-
t_blur_ptr = t_tmp_mask . fImage;
1085-
t_blur_ptr -= t_tmp_mask . fBounds . left();
1081+
uint8_t *t_mask_ptr = nullptr;
1082+
uint8_t *t_shape_ptr =
1083+
(p_mask . fImage - p_mask . fBounds . left());
1084+
uint8_t *t_blur_ptr =
1085+
(t_tmp_mask . fImage - t_tmp_mask . fBounds . left());
10861086
if (t_overlap)
10871087
{
10881088
t_mask_ptr = t_blurred_mask . getAddr8(t_inside . x(), t_inside . y());

0 commit comments

Comments
 (0)