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:
@@ -31,7 +31,7 @@
|
||||
|
||||
// increment this value if you've made a change to the c extesion
|
||||
// and want to force users to rebuild
|
||||
#define OVERVIEWER_EXTENSION_VERSION 65
|
||||
#define OVERVIEWER_EXTENSION_VERSION 66
|
||||
|
||||
/* Python PIL, and numpy headers */
|
||||
#include <Imaging.h>
|
||||
|
||||
@@ -50,10 +50,10 @@ static void
|
||||
base_finish(void* data, RenderState* state) {
|
||||
PrimitiveBase* self = (PrimitiveBase*)data;
|
||||
|
||||
Py_DECREF(self->foliagecolor);
|
||||
Py_DECREF(self->grasscolor);
|
||||
Py_DECREF(self->watercolor);
|
||||
Py_DECREF(self->grass_texture);
|
||||
Py_XDECREF(self->foliagecolor);
|
||||
Py_XDECREF(self->grasscolor);
|
||||
Py_XDECREF(self->watercolor);
|
||||
Py_XDECREF(self->grass_texture);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user