summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@canonical.com>2011-02-04 00:15:13 -0800
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-04 08:57:11 +0000
commit6e721e098b9181e8e77e314f966729d28e705582 (patch)
tree984764f409bc8d8b46f3e4390407daf1446eb97b
parentda990536eca09c6de74627541cd56ecfad925eda (diff)
Check return value of uxa_acquire_solid() since it can return NULL
uxa_acquire_solid returns NULL under OOM. Thus the value of solid must be checked before dereferencing it in the uxa_get_offscreen() call. Signed-off-by: Bryce Harrington <bryce@canonical.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--uxa/uxa-accel.c8
-rw-r--r--uxa/uxa-render.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index a5066c8e..0650ac2a 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -120,6 +120,10 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
solid = uxa_acquire_solid(screen, src->pSourcePict);
FreePicture(src, 0);
+ if (!solid) {
+ FreePicture(dst, 0);
+ goto solid;
+ }
src = solid;
src_pixmap = uxa_get_offscreen_pixmap(src->pDrawable,
@@ -1110,6 +1114,10 @@ try_solid:
solid = uxa_acquire_solid(screen, src->pSourcePict);
FreePicture(src, 0);
+ if (!solid) {
+ FreePicture(dst, 0);
+ goto err;
+ }
src = solid;
src_pixmap = uxa_get_offscreen_pixmap(src->pDrawable,
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 02bfa039..0f06e822 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -1061,6 +1061,8 @@ try_solid:
int src_off_x, src_off_y;
solid = uxa_acquire_solid(screen, src->pSourcePict);
+ if (!solid)
+ goto err_src;
FreePicture(src, 0);
src = solid;