diff --git a/src/glamor_pixmap.c b/src/glamor_pixmap.c index 9bbc989..84694ec 100644 --- a/src/glamor_pixmap.c +++ b/src/glamor_pixmap.c @@ -1377,6 +1377,11 @@ 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); + free(sub_pixmap_priv); + return NULL; + } if (pbo) { assert(sub_pixmap->devPrivate.ptr == NULL); sub_pixmap->devPrivate.ptr = data;