don't allocate an array of pointers to structs when you want an array of

structs. Fixes cases where you need a lot of relocs so you overflow the
array.

Commited upstream about ten minutes ago. ok matthieu@
This commit is contained in:
oga 2010-04-11 18:04:04 +00:00
parent 4944ac9995
commit d0eeea4b45

View File

@ -436,7 +436,7 @@ drm_intel_setup_reloc_list(drm_intel_bo *bo)
bo_gem->relocs = malloc(max_relocs *
sizeof(struct drm_i915_gem_relocation_entry));
bo_gem->reloc_target_info = malloc(max_relocs *
sizeof(drm_intel_reloc_target *));
sizeof(drm_intel_reloc_target));
if (bo_gem->relocs == NULL || bo_gem->reloc_target_info == NULL) {
bo_gem->has_error = 1;