Unbreak run-time (fix use-after-free when talking with XRandr).

Initial report from Roman Yakovlev.
This commit is contained in:
zhuk 2016-04-24 11:07:55 +00:00
parent fb03465b0f
commit b864c0b022
2 changed files with 23 additions and 1 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.4 2016/03/26 20:37:35 zhuk Exp $
# $OpenBSD: Makefile,v 1.5 2016/04/24 11:07:55 zhuk Exp $
COMMENT = arcade-puzzle game
V = 0.3.2
DISTNAME = jag-${V}
CATEGORIES = games
HOMEPAGE = http://jag.xlabsoft.com
REVISION = 0
# GPLv3
PERMIT_PACKAGE_CDROM = Yes

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-displaywrapper_cpp,v 1.1 2016/04/24 11:07:55 zhuk Exp $
--- displaywrapper.cpp.orig Sun Apr 24 13:55:59 2016
+++ displaywrapper.cpp Sun Apr 24 13:56:19 2016
@@ -280,8 +280,6 @@ void DisplayWrapper::dw_init(bool filter, int minWidth
//short original_rate = XRRConfigCurrentRate(conf);
//SizeID original_size_id = XRRConfigCurrentConfiguration(conf, &original_rotation);
- XCloseDisplay(dpy);
-
for (int i = 0; i < num_sizes; i++)
{
int width = xrrs[i].width;
@@ -300,6 +298,8 @@ void DisplayWrapper::dw_init(bool filter, int minWidth
modes.append(mode);
}
}
+
+ XCloseDisplay(dpy);
if (filter)
modeNames.removeDuplicates();