diff options
| author | 2023-04-26 15:59:48 -0400 | |
|---|---|---|
| committer | 2023-04-27 09:09:25 -0400 | |
| commit | fd1f557c48bf3a36f3a5313484698abf61df9b45 (patch) | |
| tree | 85345d91034ade69c7b0770d4d84d13e556c69dc | |
| parent | 8bf29931eabb065027fda7ffa7db294b04772a36 (diff) | |
Convert backend texture creation failure from ALOGE to FATAL log
If the texture is invalid, we'll hit a fatal log later, but at that
point we won't have the stack trace to see where the invalid texture
was coming from. Convert this log into fatal so we can get a stack
trace that includes the caller.
In addition, abort if the texture has a width or height of zero, which
has been seen in recent crashes.
Bug: 279524845
Test: make
Change-Id: I1c8593c3da533692a43bd251dcdf2baa9572041a
| -rw-r--r-- | libs/renderengine/skia/AutoBackendTexture.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/renderengine/skia/AutoBackendTexture.cpp b/libs/renderengine/skia/AutoBackendTexture.cpp index 932be56cde..c412c9cff7 100644 --- a/libs/renderengine/skia/AutoBackendTexture.cpp +++ b/libs/renderengine/skia/AutoBackendTexture.cpp @@ -43,10 +43,12 @@ AutoBackendTexture::AutoBackendTexture(GrDirectContext* context, AHardwareBuffer createProtectedImage, backendFormat, isOutputBuffer); mColorType = GrAHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format); - ALOGE_IF(!mBackendTexture.isValid(), - "Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d isWriteable:%d " - "format:%d", - this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format); + if (!mBackendTexture.isValid() || !desc.width || !desc.height) { + LOG_ALWAYS_FATAL("Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d " + "isWriteable:%d format:%d", + this, desc.width, desc.height, createProtectedImage, isOutputBuffer, + desc.format); + } } AutoBackendTexture::~AutoBackendTexture() { |