Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -78,12 +78,13 @@ // All fields are initialized by the class or to zero. // Does not send any messages or otherwise notify anyone that it has been created. // Returns VOIDLINK if object cannot be created. Uint32 n; Class*cl=classes[c]; - Object*o=calloc(1,sizeof(Object)+cl->uservars*sizeof(Value)); + Object*o=0; if(!c || !cl || cl->cflags&(CF_GROUP|CF_NOCLASS2)) goto bad; + o=calloc(1,sizeof(Object)+cl->uservars*sizeof(Value)); if(!o) fatal("Allocation failed\n"); o->class=c; o->generation=generation_number; #define C(x) o->x=cl->x; C(height) C(weight) C(climb) C(density) C(volume) C(strength) C(arrivals) C(departures) C(temperature) Index: main.c ================================================================== --- main.c +++ main.c @@ -205,10 +205,12 @@ Uint32 o; Uint32 mru[2]; if(lvl<0 && level_index && -lvl<=level_nindex) { lo=-lvl; lvl=level_index[~lvl]; + p=buf=read_lump(FIL_LEVEL,lvl,&sz,0); + end=buf+sz; } if(lvl<0) return "Invalid level ID"; if(!buf) return "Cannot find level"; free(level_title); level_title=0;