mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
screencast: Validate parameters of ScreencastArea
... just as we do for screenshots. https://bugzilla.gnome.org/show_bug.cgi?id=699752
This commit is contained in:
parent
9520e87a38
commit
e8d9a4bd49
1 changed files with 10 additions and 0 deletions
|
|
@ -137,6 +137,16 @@ const ScreencastService = new Lang.Class({
|
|||
if (!recorder.is_recording()) {
|
||||
let [x, y, width, height, fileTemplate, options] = params;
|
||||
|
||||
if (x < 0 || y < 0 ||
|
||||
width <= 0 || height <= 0 ||
|
||||
x + width > global.screen_width ||
|
||||
y + height > global.screen_height) {
|
||||
invocation.return_error_literal(Gio.IOErrorEnum,
|
||||
Gio.IOErrorEnum.CANCELLED,
|
||||
"Invalid params");
|
||||
return;
|
||||
}
|
||||
|
||||
recorder.set_file_template(fileTemplate);
|
||||
recorder.set_area(x, y, width, height);
|
||||
this._applyOptionalParameters(recorder, options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue