summaryrefslogtreecommitdiff
path: root/editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp')
-rw-r--r--editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp b/editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp
new file mode 100644
index 00000000000..2dd14b28b90
--- /dev/null
+++ b/editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp
@@ -0,0 +1,25 @@
+$NetBSD: patch-plugins_paint_xp_AbiPaint.cpp,v 1.1 2015/09/13 21:32:13 nros Exp $
+* Fix seg fault.
+--- plugins/paint/xp/AbiPaint.cpp.orig 2013-04-07 13:53:03.000000000 +0000
++++ plugins/paint/xp/AbiPaint.cpp
+@@ -177,6 +177,9 @@ static DECLARE_ABI_PLUGIN_METHOD(specify
+
+ // Get a frame in case we need to show an error message
+ XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
++ if (pFrame == NULL) {
++ return false;
++ }
+
+ {
+ const char * szDescList[3];
+@@ -254,6 +257,10 @@ static DECLARE_ABI_PLUGIN_METHOD(saveAsB
+ {
+ // Get a frame (for error messages) and (to) get the current view that the user is in.
+ XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame();
++ if (pFrame == NULL) {
++ g_varning("paint saveAsBmp: getLastFocussedFrame returned NULL\n");
++ return false;
++ }
+ FV_View* pView = static_cast<FV_View*>(pFrame->getCurrentView());
+
+ char *szTempFileName = NULL;