summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-15 12:08:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-15 12:08:59 +0100
commite453f276daa33a66a665e446a071d27e56ff15fe (patch)
tree93507889bbc24f875fa13af7e59174da2fba579b
parentd470f0f520f6bd160ae4acef2b4b3c86afd8dbbd (diff)
sna/io: Initialise return code to catch early segfaults
In case we are ever given an invalid buffer that we then attempt to read past the end. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 3ce3dede..0181838d 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -1771,6 +1771,7 @@ indirect_replace(struct sna *sna,
if (!src_bo)
return false;
+ ret = false;
if (sigtrap_get() == 0) {
memcpy_blt(src, ptr, pixmap->drawable.bitsPerPixel,
stride, src_bo->pitch,
@@ -1788,8 +1789,7 @@ indirect_replace(struct sna *sna,
&pixmap->drawable, bo, 0, 0,
&box, 1, 0);
sigtrap_put();
- } else
- ret = false;
+ }
kgem_bo_destroy(kgem, src_bo);