commit | e26a98217e417585030d98299044a98478a5464f | [log] [tgz] |
---|---|---|
author | Greg Kaiser <gkaiser@google.com> | Tue Apr 21 17:50:18 2020 -0700 |
committer | Greg Kaiser <gkaiser@google.com> | Tue Apr 21 18:10:25 2020 -0700 |
tree | 443eb748a3575350151c1c6bb6c4f7c6b1e2760f | |
parent | 2a6e562629e67b6b759f6f3b6ef19bfe3745117f [diff] |
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
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp index ca8a2ce..00855f9 100644 --- a/src/gpu/vk/GrVkTexture.cpp +++ b/src/gpu/vk/GrVkTexture.cpp
@@ -237,7 +237,9 @@ 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