Merge "Check for no error in getting planeLayout in lock" into rvc-dev
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp
index d8e4059..f799ce4 100644
--- a/libs/ui/Gralloc4.cpp
+++ b/libs/ui/Gralloc4.cpp
@@ -203,7 +203,7 @@
std::vector<ui::PlaneLayout> planeLayouts;
status_t err = getPlaneLayouts(bufferHandle, &planeLayouts);
- if (err != NO_ERROR && !planeLayouts.empty()) {
+ if (err == NO_ERROR && !planeLayouts.empty()) {
if (outBytesPerPixel) {
int32_t bitsPerPixel = planeLayouts.front().sampleIncrementInBits;
for (const auto& planeLayout : planeLayouts) {