summaryrefslogtreecommitdiffstats
path: root/libs/gui/BufferQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/BufferQueue.cpp')
-rw-r--r--libs/gui/BufferQueue.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index a95ac64..2fa0433 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -195,6 +195,11 @@ int BufferQueue::query(int what, int* outValue)
ATRACE_CALL();
Mutex::Autolock lock(mMutex);
+ if (outValue == NULL) {
+ ST_LOGE("query: outValue was NULL");
+ return BAD_VALUE;
+ }
+
if (mAbandoned) {
ST_LOGE("query: BufferQueue has been abandoned!");
return NO_INIT;
@@ -654,10 +659,15 @@ retry:
return NO_INIT;
}
+ if (output == NULL) {
+ ST_LOGE("connect: output was NULL");
+ return BAD_VALUE;
+ }
+
if (mConnectedApi != NO_CONNECTED_API) {
ST_LOGE("connect: already connected (cur=%d, req=%d)",
mConnectedApi, api);
- return -EINVAL;
+ return BAD_VALUE;
}
// If we disconnect and reconnect quickly, we can be in a state where our slots are
@@ -693,7 +703,7 @@ retry:
}
break;
default:
- err = -EINVAL;
+ err = BAD_VALUE;
break;
}