[gegl-qt] NodeViewImplementation: Guard against malloc calls with invalid size
- From: Jon Nordby <jonnor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl-qt] NodeViewImplementation: Guard against malloc calls with invalid size
- Date: Sat, 24 Sep 2011 20:18:58 +0000 (UTC)
commit b3ec857320b5adb5a3890c171ebc9d9913f9aa52
Author: Jon Nordby <jononor gmail com>
Date: Sat Sep 24 18:17:09 2011 +0200
NodeViewImplementation: Guard against malloc calls with invalid size
gegl-qt/internal/nodeviewimplementation.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl-qt/internal/nodeviewimplementation.cpp b/gegl-qt/internal/nodeviewimplementation.cpp
index 28c2c65..5c23ddb 100644
--- a/gegl-qt/internal/nodeviewimplementation.cpp
+++ b/gegl-qt/internal/nodeviewimplementation.cpp
@@ -297,13 +297,13 @@ NodeViewImplementation::paint(QPainter *painter, const QRectF & viewRect)
return;
}
- if (!inputNode()) {
- return;
- }
-
QRect modelRect = modelAreaFromViewArea(viewRect, options()).toRect();
gegl_rectangle_set_from_qrect(&roi, modelRect);
+ if (!inputNode() || roi.width <= 0 || roi.height <= 0) {
+ return;
+ }
+
buffer = (guchar *)g_malloc ((roi.width) * (roi.height) * 4);
gegl_node_blit (inputNode(), 1.0, &roi,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]