copybit: Check for invalid handle

Change-Id: I3b0bcb3b464aaa15994add3b2f8d6feea3becc68
This commit is contained in:
Naseer Ahmed 2011-11-14 14:43:46 -08:00
parent c30a98c79d
commit b2f68b6190

View File

@ -307,6 +307,11 @@ static int set_image(int device_fd, uint32 surfaceId, const struct copybit_image
return -EINVAL;
}
if(handle == NULL) {
LOGE("%s: invalid handle", __func__);
return -EINVAL;
}
if (handle->gpuaddr == 0) {
handle->gpuaddr = c2d_get_gpuaddr(device_fd, handle);
if(!handle->gpuaddr) {