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

Commit 2aef16f9 authored by Arun Johnson's avatar Arun Johnson
Browse files

Adding extra checks to bound linear block sizes

Bug: 326660896
Change-Id: Ia75293bf9341a8423b6fabebd87ea8bfd85171c3
parent 344143b4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2895,6 +2895,10 @@ static void extractBufferFromContext(
        jint offset,
        jint size,
        std::shared_ptr<C2Buffer> *buffer) {
    if ((offset + size) > context->capacity()) {
        ALOGW("extractBufferFromContext: offset + size provided exceed capacity");
        return;
    }
    *buffer = context->toC2Buffer(offset, size);
    if (*buffer == nullptr) {
        if (!context->mMemory) {