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
This commit is contained in:
Aaron Vaage
2015-09-03 15:12:57 -07:00
parent 0a76afb93e
commit e5b641e6ef

View File

@@ -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;
}