[gnome-shell] screenshot: Discard invalid sized areas



commit a3f625fe397a5f7a45abe265e2baa0cc80bd5860
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sat Mar 2 14:59:05 2013 +0100

    screenshot: Discard invalid sized areas
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694998

 js/ui/screenshot.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 5537bf1..2219a89 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]