Merge "Graphics:Add error check when create GraphicBuffer"
This commit is contained in:
commit
fc43e16a56
@ -62,7 +62,11 @@ public:
|
||||
bool nonNull = reply.readInt32();
|
||||
if (nonNull) {
|
||||
*buf = new GraphicBuffer();
|
||||
reply.read(**buf);
|
||||
result = reply.read(**buf);
|
||||
if(result != NO_ERROR) {
|
||||
(*buf).clear();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
result = reply.readInt32();
|
||||
return result;
|
||||
|
@ -281,6 +281,8 @@ status_t GraphicBuffer::unflatten(void const* buffer, size_t size,
|
||||
if (handle != 0) {
|
||||
status_t err = mBufferMapper.registerBuffer(handle);
|
||||
if (err != NO_ERROR) {
|
||||
width = height = stride = format = usage = 0;
|
||||
handle = NULL;
|
||||
ALOGE("unflatten: registerBuffer failed: %s (%d)",
|
||||
strerror(-err), err);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user