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