From 23def97c01be675b048c178bca8092a09414753f Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 3 Jul 2007 01:56:09 +0000 Subject: don't create gigantic pixmaps when XGetGeometry fails in FbTk::FbPixmap::copy --- src/FbTk/FbPixmap.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index 43ba1a1..75dfe34 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.cc @@ -166,13 +166,14 @@ void FbPixmap::copy(Pixmap pm, unsigned int depth, int screen_num) { unsigned int border_width, bpp; unsigned int new_width, new_height; - XGetGeometry(display(), - pm, - &root, - &x, &y, - &new_width, &new_height, - &border_width, - &bpp); + if (!XGetGeometry(display(), + pm, + &root, + &x, &y, + &new_width, &new_height, + &border_width, + &bpp)) + return; if (depth == 0) depth = bpp; -- cgit v0.11.2