Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7d515aa authored by Igor Murashkin's avatar Igor Murashkin Committed by Android (Google) Code Review
Browse files

Merge "media: ImageReader throws OutOfResourcesException when out of buffers" into klp-dev

parents 4fa9204d d901c033
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -698,8 +698,11 @@ static jboolean ImageReader_imageSetup(JNIEnv* env, jobject thiz,
    CpuConsumer* consumer = ctx->getCpuConsumer();
    CpuConsumer::LockedBuffer* buffer = ctx->getLockedBuffer();
    if (buffer == NULL) {
        ALOGE("Unable to acquire a lockedBuffer, very likely client tries to lock more than"
        ALOGW("Unable to acquire a lockedBuffer, very likely client tries to lock more than"
            " maxImages buffers");
        jniThrowException(env, OutOfResourcesException,
                  "Too many outstanding images, close existing images"
                  " to be able to acquire more.");
        return false;
    }
    status_t res = consumer->lockNextBuffer(buffer);