ptr = malloc(size);
if(!ptr) {
- fprintf(stderr, "FATAL: Out of memory\n");
- /* TODO: we should send a signal, so that the debugger kicks in */
+ fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
+ /* TODO: we should send a signal, so that the debugger kicks in? */
exit(1);
}
return ptr;
}
if(!ptr) {
- fprintf(stderr, "FATAL: Out of memory\n");
- /* TODO: we should send a signal, so that the debugger kicks in */
+ fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
+ /* TODO: we should send a signal, so that the debugger kicks in? */
exit(1);
}
return ptr;
ptr = malloc(size);
#endif
if(!ptr) {
- fprintf(stderr, "FATAL: Out of memory\n");
- /* TODO: we should send a signal, so that the debugger kicks in */
+ fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
+ /* TODO: we should send a signal, so that the debugger kicks in? */
exit(1);
}
#ifndef HAVE_CALLOC
if(center.x - radius < src->xmin)
src->xmin = center.x - radius;
if(center.x + radius > src->xmax)
- src->xmax = center.x - radius;
+ src->xmax = center.x + radius;
if(center.y - radius < src->ymin)
src->ymin = center.y - radius;
if(center.y + radius > src->ymax)
- src->ymax = center.y - radius;
+ src->ymax = center.y + radius;
}
SPOINT swf_TurnPoint(SPOINT p, MATRIX* m)
{
return 0;
}
-int swf_GetCXForm(TAG * t,CXFORM * cx,U8 alpha) //FIXME: alpha should be type bool
+int swf_GetCXForm(TAG * t,CXFORM * cx,U8 alpha)
{ CXFORM cxf;
int hasadd;
int hasmul;
fprintf(stderr, "rfxswf: Warning- no usable random generator found\n");
fprintf(stderr, "Your password will be vulnerable to dictionary attacks\n");
#endif
+ salt[2] = 0;
md5string = crypt_md5(password, salt);
tag->next = level0;
tag->prev = level0->prev;
level0->prev = tag;
- tag->prev->next = tag;
+ if(tag->prev)
+ tag->prev->next = tag;
+ else
+ swf->firstTag = tag;
changes = 1;
}
}
#ifdef INSERT_RFX_TAG
- if (swf->firstTag && swf_NextTag(swf->firstTag))
- if (swf_GetTagID(swf_NextTag(swf->firstTag))!=ST_REFLEX)
+ if (swf->firstTag && swf->firstTag->next &&
+ (swf->firstTag->id != ST_REFLEX || swf->firstTag->next->id != ST_REFLEX)
+ ) {
swf_SetBlock(swf_InsertTagBefore(swf, swf->firstTag,ST_REFLEX),"rfx",3);
+ }
#endif // INSERT_RFX_TAG
if(handle<0) {
writer_init_nullwriter(&writer);
len = swf_WriteSWF2(&writer, swf);
+ return len;
}
writer_init_filewriter(&writer, handle);
len = swf_WriteSWF2(&writer, swf);
return swf_WriteSWF(fileno(stdout),swf);
}
+SWF* swf_CopySWF(SWF*swf)
+{
+ SWF*nswf = rfx_alloc(sizeof(SWF));
+ TAG*tag, *ntag;
+ memcpy(nswf, swf, sizeof(SWF));
+ nswf->firstTag = 0;
+ tag = swf->firstTag;
+ ntag = 0;
+ while(tag) {
+ ntag = swf_CopyTag(ntag, tag);
+ if(!nswf->firstTag)
+ nswf->firstTag = ntag;
+ tag = tag->next;
+ }
+ return nswf;
+}
+
void swf_FreeTags(SWF * swf) // Frees all malloc'ed memory for tags
{ TAG * t = swf->firstTag;
#include "modules/swfaction.c"
#include "modules/swfsound.c"
#include "modules/swfdraw.c"
+#include "modules/swfrender.c"