-
Don't unlock Android buffers immediately after locking them. · e41e86d0Peter Collingbourne authored
In some Android gralloc implementations (e.g. minigbm), the lock operation corresponds to mmap, and unlock corresponds to munmap. This means that this code was previously returning an unusable buffer in the case where lockInternal is called passing LOCK_UNLOCKED (e.g. the mipmap buffer initializer in Sampler.cpp), resulting in segfaults later on. To prevent this from happening, don't unlock the native buffer and just leak the reference. Bug: b/142352330 Change-Id: I553801f32978c1d0af4597baad374381585e78ad Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44168Reviewed-by:
Lingfeng Yang <lfy@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Peter Collingbourne <pcc@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
e41e86d0
×