diff options
author | Vicent Marti | 2008-07-22 13:32:18 +0000 |
---|---|---|
committer | Vicent Marti | 2008-07-22 13:32:18 +0000 |
commit | daa32f77f87439e592105c21c5b6e80c2fadac62 (patch) | |
tree | 22c6b3176243357ab3701cf91fbf25fa437cae14 | |
parent | 1558fdb9186fd131d40a92b83c38d5dd76a3b353 (diff) | |
download | scummvm-rg350-daa32f77f87439e592105c21c5b6e80c2fadac62.tar.gz scummvm-rg350-daa32f77f87439e592105c21c5b6e80c2fadac62.tar.bz2 scummvm-rg350-daa32f77f87439e592105c21c5b6e80c2fadac62.zip |
Segfault in dirty rectangles is no longer a 'feature'. Fixed segfault with the last tab in config dialogs.
svn-id: r33200
-rw-r--r-- | gui/ThemeRenderer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index 2fb0f955ac..277adc8438 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -534,7 +534,7 @@ void ThemeRenderer::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, if (active >= 0) { Common::Rect tabRect(r.left + active * (tabWidth + tabOffset), r.top, r.left + active * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight); const uint16 tabLeft = active * (tabWidth + tabOffset); - const uint16 tabRight = r.right - tabRect.right; + const uint16 tabRight = MAX(r.right - tabRect.right, 0); queueDD(kDDTabActive, tabRect, (tabLeft << 16) | (tabRight & 0xFFFF)); queueDDText(kDDTabActive, tabRect, tabs[active]); } @@ -592,12 +592,12 @@ void ThemeRenderer::renderDirtyScreen() { Common::List<Common::Rect>::iterator cur; for (Common::List<Common::Rect>::iterator d = _dirtyScreen.begin(); d != _dirtyScreen.end(); ++d) { - cur = d++; + cur = d; do { + ++d; if (cur->intersects(*d)) - d = _dirtyScreen.erase(d); - else ++d; + d = _dirtyScreen.reverse_erase(d); } while (d != _dirtyScreen.end()); d = cur; |