Skip to content

Commit

Permalink
Add browser size sanity check
Browse files Browse the repository at this point in the history
Prevents the browser from being able to crash if the width/height is
somehow or another set to 0.
  • Loading branch information
jp9000 committed Mar 19, 2020
1 parent a25dde0 commit bbe1b34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion browser-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ bool BrowserClient::GetViewRect(
#endif
}

rect.Set(0, 0, bs->width, bs->height);
rect.Set(0, 0, bs->width < 1 ? 1 : bs->width,
bs->height < 1 ? 1 : bs->height);
#if CHROME_VERSION_BUILD >= 3578
return;
#else
Expand Down
2 changes: 1 addition & 1 deletion browser-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define OBS_BROWSER_VERSION_MAJOR 2
#define OBS_BROWSER_VERSION_MINOR 8
#define OBS_BROWSER_VERSION_PATCH 5
#define OBS_BROWSER_VERSION_PATCH 6

#ifndef MAKE_SEMANTIC_VERSION
#define MAKE_SEMANTIC_VERSION(major, minor, patch) \
Expand Down

0 comments on commit bbe1b34

Please sign in to comment.