summaryrefslogtreecommitdiff
path: root/uxa/uxa-accel.c
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 /uxa/uxa-accel.c
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>
Diffstat (limited to 'uxa/uxa-accel.c')
-rw-r--r--uxa/uxa-accel.c8
1 files changed, 8 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,