Fix gcc warning shdr may be used uninitialized

This commit is contained in:
Pan7 2016-08-22 10:41:34 +02:00
parent 282f33d813
commit d089ba9454

View file

@ -244,6 +244,8 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){
goto Fail; goto Fail;
} }
shdr = NULL;
/* process subchunks as they're encountered */ /* process subchunks as they're encountered */
while ( 1 ) { while ( 1 ) {
@ -494,6 +496,9 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj ){
break; break;
case ID_SDAT: case ID_SDAT:
if ( !shdr ) {
goto Fail;
}
shdr->data = getbytes( fp, sz ); shdr->data = getbytes( fp, sz );
break; break;