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
This commit is contained in:
Neti Ravi Kumar
2012-02-28 12:20:48 +05:30
committed by Andrew Sutherland
parent a0dc58fce0
commit 34e2e00e43

View File

@@ -321,6 +321,21 @@ int updateBufferGeometry(sp<GraphicBuffer> 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<GraphicBuffer> 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
*