diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 87ae6efee1f..31127918bc0 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -74,12 +74,7 @@ droid_create_image_from_native_buffer(_EGLDisplay *disp, { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct u_gralloc_buffer_basic_info buf_info; - struct u_gralloc_buffer_color_info color_info = { - .yuv_color_space = __DRI_YUV_COLOR_SPACE_ITU_REC601, - .sample_range = __DRI_YUV_NARROW_RANGE, - .horizontal_siting = __DRI_YUV_CHROMA_SITING_0, - .vertical_siting = __DRI_YUV_CHROMA_SITING_0, - }; + struct u_gralloc_buffer_color_info color_info; struct u_gralloc_buffer_handle gr_handle = { .handle = buf->handle, .hal_format = buf->format, @@ -89,10 +84,11 @@ droid_create_image_from_native_buffer(_EGLDisplay *disp, if (u_gralloc_get_buffer_basic_info(dri2_dpy->gralloc, &gr_handle, &buf_info)) - return 0; + return NULL; - /* May fail in some cases, defaults will be used in that case */ - u_gralloc_get_buffer_color_info(dri2_dpy->gralloc, &gr_handle, &color_info); + if (u_gralloc_get_buffer_color_info(dri2_dpy->gralloc, &gr_handle, + &color_info)) + return NULL; img = droid_create_image_from_buffer_info(dri2_dpy, buf->width, buf->height, &buf_info, &color_info, priv);