summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camera/exynos_camera.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index 8501bea..3021ff5 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -2364,10 +2364,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_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;
}