Skip to content

Commit

Permalink
All Games|Fixed: GL error and crash with msg-show 0
Browse files Browse the repository at this point in the history
UILog_Drawer() was pushing a matrix on the stack but didn't
pop it, which lead to an overflow.

See bug report: http://sourceforge.net/tracker/index.php?func=detail&aid=3497692&group_id=74815&atid=542099
  • Loading branch information
skyjake committed Mar 7, 2012
1 parent 1c11928 commit 17ee0d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doomsday/plugins/common/src/hu_log.c
Expand Up @@ -293,7 +293,7 @@ void UILog_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(cfg.mapTitle && actualMapTime < 6 * 35) return;
/// kludge end.

if(0 == pvisMsgCount) return;
if(!pvisMsgCount) return;

DGL_MatrixMode(DGL_MODELVIEW);
DGL_PushMatrix();
Expand All @@ -311,7 +311,7 @@ void UILog_Drawer(uiwidget_t* obj, const Point2Raw* offset)
}

// Nothing visible?
if(i == pvisMsgCount) return;
if(i == pvisMsgCount) goto stateCleanup;

// There is possibly fewer potentially-visible messages now.
pvisMsgCount -= firstMsg - firstPVisMsg;
Expand Down Expand Up @@ -408,6 +408,7 @@ void UILog_Drawer(uiwidget_t* obj, const Point2Raw* offset)
y += lineHeight;
}

stateCleanup:
DGL_Disable(DGL_TEXTURE_2D);
DGL_MatrixMode(DGL_MODELVIEW);
DGL_PopMatrix();
Expand Down

0 comments on commit 17ee0d9

Please sign in to comment.