OSDN Git Service

Merge "libgui: Check result in hook_dequeueBuffer_DEPRECATED" into nyc-dev
authorMike Stroyan <stroyan@google.com>
Mon, 6 Jun 2016 16:29:41 +0000 (16:29 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Mon, 6 Jun 2016 16:29:42 +0000 (16:29 +0000)
libs/gui/Surface.cpp

index 6811269..9d130cd 100644 (file)
@@ -162,6 +162,9 @@ int Surface::hook_dequeueBuffer_DEPRECATED(ANativeWindow* window,
     ANativeWindowBuffer* buf;
     int fenceFd = -1;
     int result = c->dequeueBuffer(&buf, &fenceFd);
+    if (result != OK) {
+        return result;
+    }
     sp<Fence> fence(new Fence(fenceFd));
     int waitResult = fence->waitForever("dequeueBuffer_DEPRECATED");
     if (waitResult != OK) {