Avoid accessing an invalid vector element.
calc_rects() can result in update_rects being empty.
This commit is contained in:
parent
b41db4ca8c
commit
559e25808a
1 changed files with 3 additions and 1 deletions
|
@ -406,7 +406,9 @@ void CVideo::flip()
|
|||
::SDL_Flip(frameBuffer);
|
||||
} else if(update_rects.empty() == false) {
|
||||
calc_rects();
|
||||
SDL_UpdateRects(frameBuffer, update_rects.size(), &update_rects[0]);
|
||||
if(!update_rects.empty()) {
|
||||
SDL_UpdateRects(frameBuffer, update_rects.size(), &update_rects[0]);
|
||||
}
|
||||
}
|
||||
|
||||
clear_updates();
|
||||
|
|
Loading…
Add table
Reference in a new issue