i965: map_gtt: check mapping address before adding offset
The NULL check might fail if offset isn't 0. CID: 971379 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
parent
a25a533458
commit
b02d136b5e
|
@ -2965,11 +2965,13 @@ intel_miptree_map_gtt(struct brw_context *brw,
|
|||
y /= bh;
|
||||
x /= bw;
|
||||
|
||||
base = intel_miptree_map_raw(brw, mt, map->mode) + mt->offset;
|
||||
base = intel_miptree_map_raw(brw, mt, map->mode);
|
||||
|
||||
if (base == NULL)
|
||||
map->ptr = NULL;
|
||||
else {
|
||||
base += mt->offset;
|
||||
|
||||
/* Note that in the case of cube maps, the caller must have passed the
|
||||
* slice number referencing the face.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue