gallium: fix eglExportDMABUFImageQueryMESA crash for r600
r600 does not implement pipe_screen.resource_get_param, so
dri2_resource_get_param just return false here.
eglExportDMABUFImageQueryMESA has been changed to support
multi plane resource, so some emulated multi plane format
gets here and return NULL which causes following queries
with this return value crash.
Fixes: f416a52960 ("egl: refine dma buf export to support multi plane")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13921
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37503>
This commit is contained in:
@@ -1265,9 +1265,8 @@ dri2_from_planar(struct dri_image *image, int plane, void *loaderPrivate)
|
||||
if (plane < 0) {
|
||||
return NULL;
|
||||
} else if (plane > 0) {
|
||||
uint64_t planes;
|
||||
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
|
||||
&planes) ||
|
||||
int planes;
|
||||
if (!dri2_query_image(image, __DRI_IMAGE_ATTRIB_NUM_PLANES, &planes) ||
|
||||
plane >= planes) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user