From 6fa58b7ac41fef952085727969a8857bd34709e2 Mon Sep 17 00:00:00 2001 From: arthurhung Date: Thu, 5 Nov 2020 11:56:00 +0800 Subject: Fix BLASTBufferQueueTest stuck on verifing captured pixel To prevent the captured screenshot could be different to the native rgb values and cause the verify function stuck when accessing the buffer. Test: atest libgui_test Fix: 172521710 Change-Id: I2fb47eaf4c735d3960c092dad874426f1b126fd2 --- libs/gui/tests/BLASTBufferQueue_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/gui/tests/BLASTBufferQueue_test.cpp b/libs/gui/tests/BLASTBufferQueue_test.cpp index 9299721be3..f3559fa6c1 100644 --- a/libs/gui/tests/BLASTBufferQueue_test.cpp +++ b/libs/gui/tests/BLASTBufferQueue_test.cpp @@ -123,6 +123,7 @@ protected: .apply(); mCaptureArgs.displayToken = mDisplayToken; + mCaptureArgs.dataspace = ui::Dataspace::V0_SRGB; } void setUpProducer(BLASTBufferQueueHelper adapter, sp& producer) { @@ -181,6 +182,7 @@ protected: for (uint32_t row = 0; row < height; row++) { for (uint32_t col = 0; col < width; col++) { uint8_t* pixel = (uint8_t*)(bufData + (row * stride) + col); + ASSERT_NE(nullptr, pixel); bool inRegion; if (!outsideRegion) { inRegion = row >= region.top + border && row < region.bottom - border && -- cgit v1.2.3-59-g8ed1b