aboutsummaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorMarcKe <herderkewitz@googlemail.com>2015-02-01 11:29:01 +0100
committersbrissen <sbrissen@hotmail.com>2015-03-06 13:24:34 -0500
commit9b07654fba1b8010edd5a7af4ee7ff87f84e92af (patch)
treef1a35eb5378ebbe1357c393b92afdfe5dc601a18 /camera
parentc78dde2333b0f20f4c335306baa5c50e5601efc6 (diff)
downloaddevice_samsung_kona-common-9b07654fba1b8010edd5a7af4ee7ff87f84e92af.zip
device_samsung_kona-common-9b07654fba1b8010edd5a7af4ee7ff87f84e92af.tar.gz
device_samsung_kona-common-9b07654fba1b8010edd5a7af4ee7ff87f84e92af.tar.bz2
Fix crash when switching between cameras
Change-Id: Ia164416fcbfebd5cf652d947757c575b2f9759ac
Diffstat (limited to 'camera')
-rwxr-xr-xcamera/exynos_camera.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index 31b2740..d35a6b7 100755
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -2001,10 +2001,14 @@ int exynos_camera_preview(struct exynos_camera *exynos_camera)
}
if (exynos_camera->preview_window != NULL && exynos_camera->gralloc != NULL) {
- exynos_camera->preview_window->dequeue_buffer(exynos_camera->preview_window, &window_buffer, &window_stride);
- exynos_camera->gralloc->lock(exynos_camera->gralloc, *window_buffer, GRALLOC_USAGE_YUV_ADDR | GRALLOC_USAGE_SW_WRITE_OFTEN, 0, 0, width, height, &window_data);
+ int ret = exynos_camera->preview_window->dequeue_buffer(exynos_camera->preview_window, &window_buffer, &window_stride);
+ if (ret < 0) {
+ ALOGE("%s: Error in dequeueing buffer", __func__);
+ goto error;
+ }
+ ret = exynos_camera->gralloc->lock(exynos_camera->gralloc, *window_buffer, GRALLOC_USAGE_YUV_ADDR | GRALLOC_USAGE_SW_WRITE_OFTEN, 0, 0, width, height, &window_data);
- if (window_data == NULL) {
+ if (window_data == NULL || ret == -EINVAL) {
ALOGE("%s: Unable to lock gralloc", __func__);
goto error;
}