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

Commit e5b641e6 authored by Aaron Vaage's avatar Aaron Vaage
Browse files

Resolving createByteBufferFromABuffer null input

It was found that createByteBufferFromABuffer was recieving a NULL buffer in bug
22726278. Based on returning NULL when buffer->base() == NULL, returning NULL
when buffer == NULL. This does not fix bug 22726278 - but address a problem found
while looking into it.

Bug: 22726278
Change-Id: I933b6a4a535d803576a4cdd7a1ffaf4a428c3201
parent 0a76afb9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -440,6 +440,12 @@ status_t JMediaCodec::createByteBufferFromABuffer(
    // if this is an ABuffer that doesn't actually hold any accessible memory,
    // use a null ByteBuffer
    *buf = NULL;

    if (buffer == NULL) {
        ALOGV("createByteBufferFromABuffer - given NULL, returning NULL");
        return OK;
    }

    if (buffer->base() == NULL) {
        return OK;
    }