pkgsrc-ng/editors/abiword/patches/patch-plugins_paint_xp_AbiPaint.cpp
2016-01-21 23:42:40 +01:00

26 lines
915 B
C++

$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;