summaryrefslogtreecommitdiff
path: root/src/surface.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-07-08 22:46:56 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:37 (GMT)
commita38cd8d0f121c98432a548edb024310b7b5b6265 (patch)
tree6f8fc22f473cd4f32603fcf70e2a1dee3b363050 /src/surface.cc
parentdee4f85572c63dbbdc39efc072ba81b37be7ea45 (diff)
bugfix: render_polyset() returned NULL when DAT file wasn't found -> crash
Diffstat (limited to 'src/surface.cc')
-rw-r--r--src/surface.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/surface.cc b/src/surface.cc
index afaaeb0..a4aa0a5 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -92,12 +92,13 @@ void register_builtin_surface()
PolySet *SurfaceNode::render_polyset(render_mode_e) const
{
+ PolySet *p = new PolySet();
handle_dep(filename);
QFile f(filename);
if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
PRINTF("WARNING: Can't open DAT file `%s'.", filename.toAscii().data());
- return NULL;
+ return p;
}
int lines = 0, columns = 0;
@@ -124,7 +125,6 @@ PolySet *SurfaceNode::render_polyset(render_mode_e) const
lines++;
}
- PolySet *p = new PolySet();
p->convexity = convexity;
double ox = center ? -columns/2.0 : 0;
contact: Jan Huwald // Impressum