clip->saturation.val = 1.0f;
clip->gamma.val = 1.0f;
- if ( p = strstr( s, "(sequence)" )) {
+ if ((p = strstr( s, "(sequence)" ))) {
p[ -1 ] = 0;
clip->type = ID_ISEQ;
clip->source.seq.prefix = s;
clip->source.still.name = s;
}
- *nclips++;
+ (*nclips)++;
clip->index = *nclips;
lwListAdd( (void *) clist, clip );
lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj )
{
lwSurface *surf;
- lwTexture *tex;
- lwPlugin *shdr;
+ lwTexture *tex = NULL;
+ lwPlugin *shdr = NULL;
char *s;
float v[ 3 ];
unsigned int id, flags;
break;
case ID_TFLG:
+ if(!tex) goto Fail;
flags = getU2( fp );
+ i = -1;
if ( flags & 1 ) i = 0;
if ( flags & 2 ) i = 1;
if ( flags & 4 ) i = 2;
+ if(i < 0) goto Fail;
tex->axis = i;
if ( tex->type == ID_IMAP )
tex->param.imap.axis = i;
break;
case ID_TSIZ:
+ if(!tex) goto Fail;
for ( i = 0; i < 3; i++ )
tex->tmap.size.val[ i ] = getF4( fp );
break;
case ID_TCTR:
+ if(!tex) goto Fail;
for ( i = 0; i < 3; i++ )
tex->tmap.center.val[ i ] = getF4( fp );
break;
case ID_TFAL:
+ if(!tex) goto Fail;
for ( i = 0; i < 3; i++ )
tex->tmap.falloff.val[ i ] = getF4( fp );
break;
case ID_TVEL:
+ if(!tex) goto Fail;
for ( i = 0; i < 3; i++ )
v[ i ] = getF4( fp );
tex->tmap.center.eindex = add_tvel( tex->tmap.center.val, v,
break;
case ID_TCLR:
+ if(!tex) goto Fail;
if ( tex->type == ID_PROC )
for ( i = 0; i < 3; i++ )
tex->param.proc.value[ i ] = getU1( fp ) / 255.0f;
break;
case ID_TVAL:
+ if(!tex) goto Fail;
tex->param.proc.value[ 0 ] = getI2( fp ) / 256.0f;
break;
case ID_TAMP:
+ if(!tex) goto Fail;
if ( tex->type == ID_IMAP )
tex->param.imap.amplitude.val = getF4( fp );
break;
case ID_TIMG:
+ if(!tex) goto Fail;
s = getS0( fp );
tex->param.imap.cindex = add_clip( s, &obj->clip, &obj->nclips );
break;
case ID_TAAS:
+ if(!tex) goto Fail;
tex->param.imap.aa_strength = getF4( fp );
tex->param.imap.aas_flags = 1;
break;
case ID_TREF:
+ if(!tex) goto Fail;
tex->tmap.ref_object = getbytes( fp, sz );
break;
case ID_TOPC:
+ if(!tex) goto Fail;
tex->opacity.val = getF4( fp );
break;
case ID_TFP0:
+ if(!tex) goto Fail;
if ( tex->type == ID_IMAP )
tex->param.imap.wrapw.val = getF4( fp );
break;
case ID_TFP1:
+ if(!tex) goto Fail;
if ( tex->type == ID_IMAP )
tex->param.imap.wraph.val = getF4( fp );
break;
break;
case ID_SDAT:
+ if(!shdr) goto Fail;
shdr->data = getbytes( fp, sz );
break;
If you don't need this information, failID and failpos can be NULL.
====================================================================== */
-lwObject *lwGetObject5( char *filename, picoMemStream_t *fp, unsigned int *failID, int *failpos )
+lwObject *lwGetObject5( const char *filename, picoMemStream_t *fp, unsigned int *failID, int *failpos )
{
lwObject *object;
lwLayer *layer;
/* end of the file? */
- if ( formsize <= _pico_memstream_tell( fp ) - 8 ) break;
+ if ( formsize <= (unsigned int) (_pico_memstream_tell( fp ) - 8) ) break;
/* get the next chunk header */
return NULL;
}
-int lwValidateObject5( char *filename, picoMemStream_t *fp, unsigned int *failID, int *failpos )
+int lwValidateObject5( const char *filename, picoMemStream_t *fp, unsigned int *failID, int *failpos )
{
unsigned int id, formsize, type;