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

Commit d901c033 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

media: ImageReader throws OutOfResourcesException when out of buffers

Bug: 10507939
Change-Id: I34c66485695ad6141388be85903cbecb9ebaa5ab
parent bbbc8660
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);