if (result != NO_ERROR) {
return result;
}
- memcpy(output, reply.readInplace(sizeof(*output)), sizeof(*output));
+ const void *out_data =reply.readInplace(sizeof(*output));
+ if(out_data != NULL) {
+ memcpy(output, out_data, sizeof(*output));
+ } else {
+ return BAD_VALUE;
+ }
result = reply.readInt32();
return result;
}
if (result != NO_ERROR) {
return result;
}
- memcpy(output, reply.readInplace(sizeof(*output)), sizeof(*output));
+ const void *out_data =reply.readInplace(sizeof(*output));
+ if(out_data != NULL) {
+ memcpy(output, out_data, sizeof(*output));
+ } else {
+ return BAD_VALUE;
+ }
result = reply.readInt32();
return result;
}
if (result != NO_ERROR) {
ALOGE("dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: %d", result);
return result;
+ } else if (gbuf == 0) {
+ ALOGE("dequeueBuffer: Buffer is null return");
+ return INVALID_OPERATION;
}
}