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 <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2013-09-27 05:25:54 +08:00 committed by Eric Anholt
parent e3d1d4e3ca
commit 229601e080

View File

@ -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;