From 34e2e00e43069c10f2ab21dd85cc6a4abf6388e1 Mon Sep 17 00:00:00 2001 From: Neti Ravi Kumar Date: Tue, 28 Feb 2012 12:20:48 +0530 Subject: [PATCH] libqcomui: Add null check for incoming buffer Add null check for incoming buffer in updateBufferS3DFormat function. return invalid value if buffer is NULL Change-Id: I97c535ae7291ee12648a92bff843c0c500bce4df (cherry picked from commit e009dff7644d9b0663f3939e48ad1e955b1f76b5) Conflicts: libqcomui/qcom_ui.cpp --- libqcomui/qcom_ui.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libqcomui/qcom_ui.cpp b/libqcomui/qcom_ui.cpp index 4e20ed4..da21445 100644 --- a/libqcomui/qcom_ui.cpp +++ b/libqcomui/qcom_ui.cpp @@ -321,6 +321,21 @@ int updateBufferGeometry(sp buffer, const qBufGeometry updatedGeo return 0; } +/* Update the S3D format of this buffer. +* +* @param: buffer whosei S3D format needs to be updated. +* @param: Updated buffer S3D format +*/ +int updateBufferS3DFormat(sp buffer, const int s3dFormat) +{ + if (buffer == 0) { + LOGE("%s: graphic buffer is NULL", __FUNCTION__); + return -EINVAL; + } + + buffer->format |= s3dFormat; + return 0; +} /* * Updates the flags for the layer *