The mapImage/unmapImage functions of DRIimage extension can be NULL,
so we should add additional check for them.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
return *map_data;
}
- if (!dri->image || dri->image->base.version < 12) {
+ if (!dri->image || dri->image->base.version < 12 || !dri->image->mapImage) {
errno = ENOSYS;
return NULL;
}
return;
}
- if (!dri->context || !dri->image || dri->image->base.version < 12)
+ if (!dri->context || !dri->image ||
+ dri->image->base.version < 12 || !dri->image->unmapImage)
return;
dri->image->unmapImage(dri->context, bo->image, map_data);