diff options
Diffstat (limited to 'java/org/gnu/emacs/EmacsCopyArea.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsCopyArea.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsCopyArea.java b/java/org/gnu/emacs/EmacsCopyArea.java index 7a97d706794..f8974e17c2e 100644 --- a/java/org/gnu/emacs/EmacsCopyArea.java +++ b/java/org/gnu/emacs/EmacsCopyArea.java | |||
| @@ -99,6 +99,12 @@ public class EmacsCopyArea | |||
| 99 | if (src_y + height > srcBitmap.getHeight ()) | 99 | if (src_y + height > srcBitmap.getHeight ()) |
| 100 | height = srcBitmap.getHeight () - src_y; | 100 | height = srcBitmap.getHeight () - src_y; |
| 101 | 101 | ||
| 102 | /* If width and height are empty or negative, then skip the entire | ||
| 103 | CopyArea operation lest createBitmap throw an exception. */ | ||
| 104 | |||
| 105 | if (width <= 0 || height <= 0) | ||
| 106 | return; | ||
| 107 | |||
| 102 | rect = new Rect (dest_x, dest_y, dest_x + width, | 108 | rect = new Rect (dest_x, dest_y, dest_x + width, |
| 103 | dest_y + height); | 109 | dest_y + height); |
| 104 | 110 | ||