aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kaiser <gkaiser@google.com>2020-04-21 17:50:18 -0700
committerGreg Kaiser <gkaiser@google.com>2020-04-21 18:10:25 -0700
commite26a98217e417585030d98299044a98478a5464f (patch)
tree443eb748a3575350151c1c6bb6c4f7c6b1e2760f
parent2a6e562629e67b6b759f6f3b6ef19bfe3745117f (diff)
downloadskia-e26a98217e417585030d98299044a98478a5464f.tar.gz
Avoid possible nullptr dereference
We cherry-pick the appropriate part of https://skia-review.googlesource.com/c/skia/+/279136 to rvc-dev to make sure we don't have a nullptr dereference. Since that CLs is quite large, we chose to just make this small change instead of introduce a large change. Bug: 154661346 Test: TreeHugger Change-Id: I01ac23547a345b1aed8048cd83cb7a1f1e36e331 Merged-In: I7c990413b7a966f6a330289552d4520be0f3d3d1
-rw-r--r--src/gpu/vk/GrVkTexture.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index ca8a2ce601..00855f94bd 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -237,7 +237,9 @@ void GrVkTexture::willRemoveLastRef() {
if (callFinishProcs) {
// Everything must go!
fIdleProcs.reset();
- resource->resetIdleProcs();
+ if (resource) {
+ resource->resetIdleProcs();
+ }
} else {
// The procs that should be called on flush but not finish are those that are owned
// by the GrVkTexture and not the Resource. We do this by copying the resource's array