From 56cffd7283e0af7b7969192d3217464c3abcc61b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 May 2016 11:06:31 +0530 Subject: [PATCH] Add a null image check --- src/calibre/utils/imageops/imageops.sip | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/utils/imageops/imageops.sip b/src/calibre/utils/imageops/imageops.sip index 70781bfc5c..09cae8a617 100644 --- a/src/calibre/utils/imageops/imageops.sip +++ b/src/calibre/utils/imageops/imageops.sip @@ -8,6 +8,7 @@ %ModuleCode #include #define IMAGEOPS_PREFIX \ + if (a0->isNull()) { PyErr_SetString(PyExc_ValueError, "Cannot operate on null QImage"); return NULL; } \ try { #define IMAGEOPS_SUFFIX \ } catch (std::out_of_range &exc) { PyErr_SetString(PyExc_ValueError, exc.what()); return NULL; \