0

src/primitives/base: don't try to free nullpointer

If loading the grass and foliage biome colour fails, Overviewer doesn't
necessarily crash, it just renders everything gray, apart from one small
issue: in trying to call base_finish, it'd crash trying to decrease the
reference of a null pointer.
This commit is contained in:
Nicolas F
2019-07-06 23:15:55 +02:00
parent 0b4ad361c3
commit 6b0ccc1513
2 changed files with 5 additions and 5 deletions

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extesion // increment this value if you've made a change to the c extesion
// and want to force users to rebuild // and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 65 #define OVERVIEWER_EXTENSION_VERSION 66
/* Python PIL, and numpy headers */ /* Python PIL, and numpy headers */
#include <Imaging.h> #include <Imaging.h>

View File

@@ -50,10 +50,10 @@ static void
base_finish(void* data, RenderState* state) { base_finish(void* data, RenderState* state) {
PrimitiveBase* self = (PrimitiveBase*)data; PrimitiveBase* self = (PrimitiveBase*)data;
Py_DECREF(self->foliagecolor); Py_XDECREF(self->foliagecolor);
Py_DECREF(self->grasscolor); Py_XDECREF(self->grasscolor);
Py_DECREF(self->watercolor); Py_XDECREF(self->watercolor);
Py_DECREF(self->grass_texture); Py_XDECREF(self->grass_texture);
} }
static int static int