From 229601e080aefad21927c1449cd520733317858b Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 27 Sep 2013 05:25:54 +0800 Subject: [PATCH] Shoud return null subpixmap if we fail to get a valid map address. The patch is prepared by Raul Fernandes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86693 Signed-off-by: Zhigang Gong --- glamor/glamor_pixmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 9bbc989cb..84694ec3c 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -1377,6 +1377,10 @@ glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, glamor_acces data = glamor_download_sub_pixmap_to_cpu(pixmap, x, y, w, h, sub_pixmap->devKind, data, pbo, access); + if(data == NULL) { + fbDestroyPixmap(sub_pixmap); + return NULL; + } if (pbo) { assert(sub_pixmap->devPrivate.ptr == NULL); sub_pixmap->devPrivate.ptr = data;