diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-24 16:16:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-24 16:16:25 +0100 |
commit | f3d27eec52cac63378c0e466db971ae125c813a1 (patch) | |
tree | 1ad8cb2ae7f8db845106faed8ae487a2e7e23173 /src/sna/gen8_render.c | |
parent | a60ccd546e081f5b7bd7de762e1638927a4145a2 (diff) |
sna/gen4+: Assert that the offset coordinate is within range if negative
Invalid negative offsets could slip into the drawing rectangle
without triggering the assertion - the assertion being that they were
not greater than the maximum positive coordinate of the 3d engine.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen8_render.c')
-rw-r--r-- | src/sna/gen8_render.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c index e251315b..6cc7a68b 100644 --- a/src/sna/gen8_render.c +++ b/src/sna/gen8_render.c @@ -989,7 +989,7 @@ gen8_emit_drawing_rectangle(struct sna *sna, uint32_t limit = (op->dst.height - 1) << 16 | (op->dst.width - 1); uint32_t offset = (uint16_t)op->dst.y << 16 | (uint16_t)op->dst.x; - assert(!too_large(op->dst.x, op->dst.y)); + assert(!too_large(abs(op->dst.x), abs(op->dst.y))); assert(!too_large(op->dst.width, op->dst.height)); if (sna->render_state.gen8.drawrect_limit == limit && |