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

Commit 2aff7025 authored by Lingyun Zhu's avatar Lingyun Zhu Committed by Jesse Hall
Browse files

Graphics:Add error check when create GraphicBuffer



Change-Id: Ib0ca59bf1dfe4ae0266c29c91c1dbe3d02c0904e
Author: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: default avatarLingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: default avatarShuo Gao <shuo.gao@intel.com>
Signed-off-by: default avatarBruce Beare <bruce.j.beare@intel.com>
Signed-off-by: default avatarJack Ren <jack.ren@intel.com>
Author-tracking-BZ: 50141
parent 046b72fc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
+2 −0
Original line number Diff line number Diff line
@@ -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;