diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2018-10-14 23:36:14 +0100 |
---|---|---|
committer | frosch <github@elsenhans.name> | 2018-10-31 12:41:49 +0100 |
commit | b5028efc1fa862073c908c435f84098ccd246fdc (patch) | |
tree | ec0a38f99b8885e4d977bb4e5ece8fd37d96a8e3 /src/window.cpp | |
parent | 52ed3bcbaa88717ab50f71150ed9fc0b6af4715a (diff) | |
download | openttd-b5028efc1fa862073c908c435f84098ccd246fdc.tar.xz |
Fix: Protect against a few out of bounds or uninitialised usage errors
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index d7911bfa4..cd8769e27 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -938,6 +938,8 @@ static void DrawOverlappedWindow(Window *w, int left, int top, int right, int bo void DrawOverlappedWindowForAll(int left, int top, int right, int bottom) { Window *w; + + DrawPixelInfo *old_dpi = _cur_dpi; DrawPixelInfo bk; _cur_dpi = &bk; @@ -951,6 +953,7 @@ void DrawOverlappedWindowForAll(int left, int top, int right, int bottom) DrawOverlappedWindow(w, max(left, w->left), max(top, w->top), min(right, w->left + w->width), min(bottom, w->top + w->height)); } } + _cur_dpi = old_dpi; } /** |