screenshot: Discard invalid sized areas

https://bugzilla.gnome.org/show_bug.cgi?id=694998
This commit is contained in:
Adel Gadllah 2013-03-02 14:59:05 +01:00
parent bdfe459d64
commit a3f625fe39

View File

@ -76,6 +76,11 @@ const ScreenshotService = new Lang.Class({
ScreenshotAreaAsync : function (params, invocation) {
let [x, y, width, height, flash, filename, callback] = params;
if (height <= 0 || width <= 0) {
invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
"Invalid params");
return;
}
let screenshot = new Shell.Screenshot();
screenshot.screenshot_area (x, y, width, height, filename,
Lang.bind(this, this._onScreenshotComplete,