[gnome-shell/gnome-3-10] screencast: Validate parameters of ScreencastArea
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-10] screencast: Validate parameters of ScreencastArea
- Date: Mon, 4 Nov 2013 16:00:25 +0000 (UTC)
commit f83144b79aadef4e02073f2c4a30d82133ce565a
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Nov 4 14:09:19 2013 +0100
screencast: Validate parameters of ScreencastArea
... just as we do for screenshots.
https://bugzilla.gnome.org/show_bug.cgi?id=699752
js/ui/screencast.js | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screencast.js b/js/ui/screencast.js
index 85ce4d7..67a4280 100644
--- a/js/ui/screencast.js
+++ b/js/ui/screencast.js
@@ -135,6 +135,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]