diff options
author | rubidium <rubidium@openttd.org> | 2009-01-07 18:59:46 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-07 18:59:46 +0000 |
commit | c71862174a60e0719751afa9ca8f2ebcaa774f39 (patch) | |
tree | 27f5fec9105c3877775dd0123f12b68561def938 /src/viewport.cpp | |
parent | 6bd14cf1a16f13f7b24d6eb869316a740b89b069 (diff) | |
download | openttd-c71862174a60e0719751afa9ca8f2ebcaa774f39.tar.xz |
(svn r14905) -Fix (r14899): in some corner cases already freed memory could be read.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 64f4898a1..88278309b 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -219,8 +219,7 @@ static Point _vp_move_offs; static void DoSetViewportPosition(const Window *w, int left, int top, int width, int height) { - - for (; w != NULL; w = w->z_front) { + FOR_ALL_WINDOWS_FROM_BACK_FROM(w, w) { if (left + width > w->left && w->left + w->width > left && top + height > w->top && |