[iortcw] 275/497: All: Make Window_Paint check if w is NULL before dereference

2017-09-08 Thread Simon McVittie
This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 4a9d5aea494ba330009109b4917df649dba0d281
Author: m4n4t4...@gmail.com 

Date:   Tue Jan 13 23:17:03 2015 +

All: Make Window_Paint check if w is NULL before dereference
---
 MP/code/ui/ui_shared.c | 10 --
 SP/code/ui/ui_shared.c | 10 --
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c
index 569905c..1564c84 100644
--- a/MP/code/ui/ui_shared.c
+++ b/MP/code/ui/ui_shared.c
@@ -663,17 +663,23 @@ void Fade( int *flags, float *f, float clamp, int 
*nextTime, int offsetTime, qbo
 void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float 
fadeCycle ) {
//float bordersize = 0;
vec4_t color = {0};
-   rectDef_t fillRect = w->rect;
+   rectDef_t fillRect;
+
+   if ( w == NULL ) {
+   return;
+   }
 
if ( debugMode ) {
color[0] = color[1] = color[2] = color[3] = 1;
DC->drawRect( w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, 
color );
}
 
-   if ( w == NULL || ( w->style == 0 && w->border == 0 ) ) {
+   if ( w->style == 0 && w->border == 0 ) {
return;
}
 
+   fillRect = w->rect;
+
if ( w->border != 0 ) {
fillRect.x += w->borderSize;
fillRect.y += w->borderSize;
diff --git a/SP/code/ui/ui_shared.c b/SP/code/ui/ui_shared.c
index 591394f..e258082 100644
--- a/SP/code/ui/ui_shared.c
+++ b/SP/code/ui/ui_shared.c
@@ -717,17 +717,23 @@ void Fade( int *flags, float *f, float clamp, int 
*nextTime, int offsetTime, qbo
 void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float 
fadeCycle ) {
//float bordersize = 0;
vec4_t color = {0};
-   rectDef_t fillRect = w->rect;
+   rectDef_t fillRect;
+
+   if ( w == NULL ) {
+   return;
+   }
 
if ( debugMode ) {
color[0] = color[1] = color[2] = color[3] = 1;
DC->drawRect( w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, 
color );
}
 
-   if ( w == NULL || ( w->style == 0 && w->border == 0 ) ) {
+   if ( w->style == 0 && w->border == 0 ) {
return;
}
 
+   fillRect = w->rect;
+
if ( w->border != 0 ) {
fillRect.x += w->borderSize;
fillRect.y += w->borderSize;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

___
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits


[iortcw] 275/497: All: Make Window_Paint check if w is NULL before dereference

2016-09-21 Thread Simon McVittie
This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 4a9d5aea494ba330009109b4917df649dba0d281
Author: m4n4t4...@gmail.com 

Date:   Tue Jan 13 23:17:03 2015 +

All: Make Window_Paint check if w is NULL before dereference
---
 MP/code/ui/ui_shared.c | 10 --
 SP/code/ui/ui_shared.c | 10 --
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c
index 569905c..1564c84 100644
--- a/MP/code/ui/ui_shared.c
+++ b/MP/code/ui/ui_shared.c
@@ -663,17 +663,23 @@ void Fade( int *flags, float *f, float clamp, int 
*nextTime, int offsetTime, qbo
 void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float 
fadeCycle ) {
//float bordersize = 0;
vec4_t color = {0};
-   rectDef_t fillRect = w->rect;
+   rectDef_t fillRect;
+
+   if ( w == NULL ) {
+   return;
+   }
 
if ( debugMode ) {
color[0] = color[1] = color[2] = color[3] = 1;
DC->drawRect( w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, 
color );
}
 
-   if ( w == NULL || ( w->style == 0 && w->border == 0 ) ) {
+   if ( w->style == 0 && w->border == 0 ) {
return;
}
 
+   fillRect = w->rect;
+
if ( w->border != 0 ) {
fillRect.x += w->borderSize;
fillRect.y += w->borderSize;
diff --git a/SP/code/ui/ui_shared.c b/SP/code/ui/ui_shared.c
index 591394f..e258082 100644
--- a/SP/code/ui/ui_shared.c
+++ b/SP/code/ui/ui_shared.c
@@ -717,17 +717,23 @@ void Fade( int *flags, float *f, float clamp, int 
*nextTime, int offsetTime, qbo
 void Window_Paint( Window *w, float fadeAmount, float fadeClamp, float 
fadeCycle ) {
//float bordersize = 0;
vec4_t color = {0};
-   rectDef_t fillRect = w->rect;
+   rectDef_t fillRect;
+
+   if ( w == NULL ) {
+   return;
+   }
 
if ( debugMode ) {
color[0] = color[1] = color[2] = color[3] = 1;
DC->drawRect( w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, 
color );
}
 
-   if ( w == NULL || ( w->style == 0 && w->border == 0 ) ) {
+   if ( w->style == 0 && w->border == 0 ) {
return;
}
 
+   fillRect = w->rect;
+
if ( w->border != 0 ) {
fillRect.x += w->borderSize;
fillRect.y += w->borderSize;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

___
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits