X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfrender.c;h=a9d5d077dfcc60c1b981f8ea263de95dcf8e9c18;hb=1d75a2772012bc5cbf238f7d363c650daa6f4c6a;hp=fd9cb1aca5d5be1d2f7c27baf2620f5a0e59fb85;hpb=37526907b1319f02bc53cc80eb90c149d8459338;p=swftools.git diff --git a/lib/modules/swfrender.c b/lib/modules/swfrender.c index fd9cb1a..a9d5d07 100644 --- a/lib/modules/swfrender.c +++ b/lib/modules/swfrender.c @@ -304,12 +304,12 @@ void swf_Render_Init(RENDERBUF*buf, int posx, int posy, int width, int height, c void swf_Render_SetBackground(RENDERBUF*buf, RGBA*img, int width, int height) { renderbuf_internal*i = (renderbuf_internal*)buf->internal; - if(i->shapes) { - fprintf(stderr, "rfxswf: Warning: swf_Render_SetBackground() called after drawing shapes\n"); - } int x,xx,y,yy; int xstep=width*65536/i->width2; int ystep=height*65536/i->height2; + if(i->shapes) { + fprintf(stderr, "rfxswf: Warning: swf_Render_SetBackground() called after drawing shapes\n"); + } for(y=0,yy=0;yheight2;y++,yy+=ystep) { RGBA*src = &img[(yy>>16) * width]; RGBA*line = &i->img[y * i->width2]; @@ -832,6 +832,8 @@ void swf_Process(RENDERBUF*dest, U32 clipdepth) endx = i->width2; if(startx < 0) startx = 0; + if(endx < 0) + endx = 0; if(clipdepth) { /* for clipping, the inverse is filled */ @@ -881,9 +883,10 @@ RGBA* swf_Render(RENDERBUF*dest) if(y&1) { int x; RGBA*line1=line; + RGBA* p; if(!line2) line2=line1; - RGBA* p = &img[(y/2)*dest->width]; + p = &img[(y/2)*dest->width]; for(x=0;xwidth;x++) { RGBA*p1 = &line1[x*2]; RGBA*p2 = &line1[x*2+1]; @@ -957,6 +960,8 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) TAG*tag; int t; int numplacements; + RGBA color; + SWFPLACEOBJECT* placements; character_t* idtable = rfx_calloc(sizeof(character_t)*65536); // id to character mapping SWFPLACEOBJECT** depthtable = rfx_calloc(sizeof(SWFPLACEOBJECT*)*65536); // depth to placeobject mapping @@ -970,11 +975,11 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) } tag = tag->next; } - SWFPLACEOBJECT* placements = rfx_calloc(sizeof(SWFPLACEOBJECT)*numplacements); + placements = rfx_calloc(sizeof(SWFPLACEOBJECT)*numplacements); numplacements = 0; /* set background color */ - RGBA color = swf_GetSWFBackgroundColor(swf); + color = swf_GetSWFBackgroundColor(swf); swf_Render_SetBackgroundColor(buf, color); /* parse definitions */ @@ -1014,6 +1019,7 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) swf_GetPlaceObject(tag, &p); /* TODO: add move and deletion */ placements[numplacements++] = p; + swf_PlaceObjectFree(&p); //dirty! but it only removes items we don't need } tag = tag->next; } @@ -1053,6 +1059,7 @@ void swf_RenderSWF(RENDERBUF*buf, SWF*swf) } } } + free(placements); free(idtable); free(depthtable); }