X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=lib%2Fmodules%2Fswfshape.c;h=cbc138939572dcca53cca3f8e64fbc27f6d81b50;hb=c08ca7ae32906b1cbb6a4b91c3cb3e09ab91800e;hp=3ecd8ffd46babe68567b84b4956e2896f5b31bf5;hpb=390a62127f55bf5681356b42197e9714e579fe85;p=swftools.git diff --git a/lib/modules/swfshape.c b/lib/modules/swfshape.c index 3ecd8ff..cbc1389 100644 --- a/lib/modules/swfshape.c +++ b/lib/modules/swfshape.c @@ -27,15 +27,11 @@ #define SF_LINE 0x08 #define SF_NEWSTYLE 0x10 -#define FILL_SOLID 0x00 -#define FILL_LINEAR 0x10 // Gradient -#define FILL_RADIAL 0x12 -#define FILL_TILED 0x40 // Bitmap -#define FILL_CLIPPED 0x41 - void swf_ShapeFree(SHAPE * s) -{ if (s) - { if (s->linestyle.data) free(s->linestyle.data); +{ + if(!s) + return; + if (s->linestyle.data) free(s->linestyle.data); s->linestyle.data = NULL; s->linestyle.n = 0; if (s->fillstyle.data) free(s->fillstyle.data); @@ -43,16 +39,17 @@ void swf_ShapeFree(SHAPE * s) s->fillstyle.n = 0; if (s->data) free(s->data); s->data = NULL; - } - free(s); + free(s); } int swf_ShapeNew(SHAPE * * s) -{ SHAPE * sh; - if (!s) return -1; - sh = (SHAPE *)malloc(sizeof(SHAPE)); s[0] = sh; - if (sh) memset(sh,0x00,sizeof(SHAPE)); - return sh?0:-1; +{ + SHAPE * sh; + if (!s) return -1; + sh = (SHAPE *)malloc(sizeof(SHAPE)); + *s = sh; + memset(sh,0,sizeof(SHAPE)); + return 0; } int swf_GetSimpleShape(TAG * t,SHAPE * * s) // without Linestyle/Fillstyle Record @@ -169,8 +166,6 @@ int swf_SetFillStyle(TAG * t,FILLSTYLE * f) { if ((!t)||(!f)) return -1; swf_SetU8(t,f->type); - // no gradients yet! - switch (f->type) { case FILL_SOLID: if (swf_GetTagID(t)!=ST_DEFINESHAPE3) swf_SetRGB(t,&f->color);