From: Kevin Lubick Date: Tue, 14 Mar 2017 21:20:24 +0000 (-0400) Subject: Fix uninitialized values in FuzzCanvas X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~46^2~559 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dad29a059e11158c97e575747e7769a2a4fb9179;p=platform%2Fupstream%2FlibSkiaSharp.git Fix uninitialized values in FuzzCanvas BUG=skia: Change-Id: I45cb8a2d0695ec9a065ea9dd216e5d0220ad5a98 Reviewed-on: https://skia-review.googlesource.com/9690 Commit-Queue: Kevin Lubick Reviewed-by: Kevin Lubick --- diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp index afd61a1..bfc90f5 100644 --- a/fuzz/FuzzCanvas.cpp +++ b/fuzz/FuzzCanvas.cpp @@ -687,11 +687,11 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { case 1: { SkScalar sigmaX, sigmaY; sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); - SkImageFilter::CropRect cropRect; bool useCropRect; fuzz->next(&sigmaX, &sigmaY, &useCropRect); + SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkImageFilter::MakeBlur(sigmaX, sigmaY, std::move(input), useCropRect ? &cropRect : nullptr); @@ -707,11 +707,11 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { SkRegion region; SkScalar innerMin, outerMax; sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); - SkImageFilter::CropRect cropRect; bool useCropRect; fuzz->next(®ion, &innerMin, &outerMax, &useCropRect); + SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkAlphaThresholdFilter::Make(region, innerMin, outerMax, std::move(input), useCropRect ? &cropRect : nullptr); @@ -725,7 +725,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { sk_sp foreground = make_fuzz_imageFilter(fuzz, depth - 1); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkArithmeticImageFilter::Make(k1, k2, k3, k4, enforcePMColor, std::move(background), std::move(foreground), @@ -738,7 +738,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { SkImageFilter::CropRect cropRect; fuzz->next(&useCropRect); if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkColorFilterImageFilter::Make(std::move(cf), std::move(input), useCropRect ? &cropRect : nullptr); @@ -757,7 +757,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&scale, &useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp displacement = make_fuzz_imageFilter(fuzz, depth - 1); sk_sp color = make_fuzz_imageFilter(fuzz, depth - 1); @@ -774,7 +774,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&dx, &dy, &sigmaX, &sigmaY, &color, &useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkDropShadowImageFilter::Make(dx, dy, sigmaX, sigmaY, color, shadowMode, @@ -799,7 +799,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { SkImageFilter::CropRect cropRect; fuzz->next(&srcRect, &inset, &useCropRect); if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkMagnifierImageFilter::Make(srcRect, inset, std::move(input), @@ -822,7 +822,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz_enum_range(fuzz, &tileMode, 0, 2); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkMatrixConvolutionImageFilter::Make( @@ -837,7 +837,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect, &blendMode); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkMergeImageFilter::Make(std::move(first), std::move(second), blendMode, useCropRect ? &cropRect : nullptr); @@ -856,7 +856,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkMergeImageFilter::MakeN(ifs, count, blendModes, useCropRect ? &cropRect : nullptr); @@ -868,7 +868,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkDilateImageFilter::Make(rx, ry, std::move(input), @@ -881,7 +881,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkErodeImageFilter::Make(rx, ry, std::move(input), @@ -894,7 +894,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp input = make_fuzz_imageFilter(fuzz, depth - 1); return SkOffsetImageFilter::Make(dx, dy, std::move(input), @@ -907,7 +907,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } return SkPaintImageFilter::Make(paint, useCropRect ? &cropRect : nullptr); } @@ -941,7 +941,7 @@ static sk_sp make_fuzz_imageFilter(Fuzz* fuzz, int depth) { fuzz->next(&useCropRect, &blendMode); SkImageFilter::CropRect cropRect; if (useCropRect) { - fuzz->next(&useCropRect); + fuzz->next(&cropRect); } sk_sp bg = make_fuzz_imageFilter(fuzz, depth - 1); sk_sp fg = make_fuzz_imageFilter(fuzz, depth - 1);