diff --git a/libs/picomodel/lwo/envelope.c b/libs/picomodel/lwo/envelope.c index db7000ad..4510dade 100644 --- a/libs/picomodel/lwo/envelope.c +++ b/libs/picomodel/lwo/envelope.c @@ -75,6 +75,8 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize ){ goto Fail; } + key = NULL; + /* process subchunks as they're encountered */ while ( 1 ) { diff --git a/libs/picomodel/lwo/lwob.c b/libs/picomodel/lwo/lwob.c index 57cc0c52..d59b8f07 100644 --- a/libs/picomodel/lwo/lwob.c +++ b/libs/picomodel/lwo/lwob.c @@ -244,6 +244,8 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){ goto Fail; } + shdr = NULL; + /* process subchunks as they're encountered */ while ( 1 ) { @@ -494,6 +496,9 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){ break; case ID_SDAT: + if ( !shdr ) { + goto Fail; + } shdr->data = getbytes( fp, sz ); break;