From 06f3c048a6d923a2d15c473d3c780ee641836ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Tue, 30 Apr 2013 08:56:57 +0200 Subject: [PATCH] 2013-04-30 08:56 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbct/ctwin.c ! added protection against GPF when reverted coordinates are used in WOPEN() --- ChangeLog.txt | 5 +++++ contrib/hbct/ctwin.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index eb3715eff5..4c4d880a88 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,11 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-30 08:56 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbct/ctwin.c + ! added protection against GPF when reverted coordinates are used + in WOPEN() + 2013-04-30 02:53 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/gtqtc/gtqtc1.cpp ! reverted HB_GTI_DISPIMAGE cords diff --git a/contrib/hbct/ctwin.c b/contrib/hbct/ctwin.c index b6cde20af7..6654db738d 100644 --- a/contrib/hbct/ctwin.c +++ b/contrib/hbct/ctwin.c @@ -2474,13 +2474,17 @@ int hb_ctwSetBorderMode( int iTop, int iLeft, int iBottom, int iRight ) int hb_ctwCreateWindow( int iTop, int iLeft, int iBottom, int iRight, HB_BOOL fClear, int iColor, HB_BOOL fVisible ) { int iResult = -1; - PHB_GTCTW pCTW = hb_ctw_base(); - if( pCTW ) + if( iTop <= iBottom && iLeft <= iRight ) { - iResult = hb_ctw_CreateWindow( pCTW, iTop, iLeft, iBottom, iRight, fClear, iColor, fVisible ); - HB_GTSELF_FLUSH( pCTW->pGT ); - hb_gt_BaseFree( pCTW->pGT ); + PHB_GTCTW pCTW = hb_ctw_base(); + + if( pCTW ) + { + iResult = hb_ctw_CreateWindow( pCTW, iTop, iLeft, iBottom, iRight, fClear, iColor, fVisible ); + HB_GTSELF_FLUSH( pCTW->pGT ); + hb_gt_BaseFree( pCTW->pGT ); + } } return iResult; }