From 282f33d813e896b25f0465c916bdfa369f2da6dd Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 21 Aug 2016 21:35:42 +0200 Subject: [PATCH 1/2] Fix for potentially using uninitialized variable --- libs/picomodel/lwo/envelope.c | 2 ++ 1 file changed, 2 insertions(+) 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 ) { From d089ba94541eb7a22aef6d4fb4dca17a2adb9303 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Mon, 22 Aug 2016 10:41:34 +0200 Subject: [PATCH 2/2] Fix gcc warning shdr may be used uninitialized --- libs/picomodel/lwo/lwob.c | 5 +++++ 1 file changed, 5 insertions(+) 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;