aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/SkPictureShader.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-04-19 21:07:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-20 14:14:45 +0000
commit8f88d89796d0ab7fefb302b21e03cc186dfc8bc3 (patch)
tree8cff6d250fdb65877142c1a1d9890b3ce7b9ea77 /src/shaders/SkPictureShader.h
parentadeb75d67caff878ce6c5f8654c34c3fdd201776 (diff)
Fix use-of-uninitialized-value in SkPictureShader::onMakeContext
SkPictureShader::refBitmapShader is expected to always initialize the scale adjust vector when returning a non-null shader. But the code path returning EmptyShader does not do that. Instead of hauling around a separate scale adjustment, we can refactor to avoid this problem by adjusting the local matrix directly, if needed, in refBitmapShader. The local matrix is conveniently already stored in a SkTCopyOnFirstWrite. Bug: chromium:835048, oss-fuzz:7738 Change-Id: I2df3bde7d6237f01bc71857c2fe254e86b186dc0 Reviewed-on: https://skia-review.googlesource.com/122544 Auto-Submit: Florin Malita <fmalita@chromium.org> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/shaders/SkPictureShader.h')
-rw-r--r--src/shaders/SkPictureShader.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/shaders/SkPictureShader.h b/src/shaders/SkPictureShader.h
index 5f28b6074b..6e5201e8fb 100644
--- a/src/shaders/SkPictureShader.h
+++ b/src/shaders/SkPictureShader.h
@@ -46,9 +46,8 @@ private:
SkPictureShader(sk_sp<SkPicture>, TileMode, TileMode, const SkMatrix*, const SkRect*,
sk_sp<SkColorSpace>);
- sk_sp<SkShader> refBitmapShader(const SkMatrix&, const SkMatrix& localMatrix,
+ sk_sp<SkShader> refBitmapShader(const SkMatrix&, SkTCopyOnFirstWrite<SkMatrix>* localMatrix,
SkColorSpace* dstColorSpace,
- SkVector* scaleAdjust,
const int maxTextureSize = 0) const;
class PictureShaderContext : public Context {