1. seandroid
  2. Untitled project
  3. frameworks-native

Commits

Jesse Hall  committed fc43e16 Merge

Merge "Graphics:Add error check when create GraphicBuffer"

  • Participants
  • Parent commits 046b72f, 2aff702
  • Branches master

Comments (0)

Files changed (2)

File libs/gui/IGraphicBufferProducer.cpp

View file
         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;

File libs/ui/GraphicBuffer.cpp

View file
     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;