summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-07-13 16:08:34 +0100
committerLionel Landwerlin <[email protected]>2017-07-13 22:50:32 +0100
commitb02d136b5e14f94e5f3ab8489f0fbfaa88e76820 (patch)
tree7cc20c22e137dbf5e94821d8d75cb9fcecaf0317 /src
parenta25a53345859c3c560b923de3359c245db81c5e6 (diff)
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 <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 575f04f8648..e7ebc29b59d 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -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.
*/