git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added USE_GZIP
[swftools.git]
/
lib
/
rfxswf.c
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
7b2bf69
..
7754ba9
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-16,6
+16,7
@@
#ifdef HAVE_LIBJPEG
#ifdef HAVE_JPEGLIB_H
#ifdef HAVE_LIBJPEG
#ifdef HAVE_JPEGLIB_H
+#define HAVE_BOOLEAN
#include <jpeglib.h>
#define _JPEGLIB_INCLUDED_
#endif // HAVE_JPEGLIB_H
#include <jpeglib.h>
#define _JPEGLIB_INCLUDED_
#endif // HAVE_JPEGLIB_H
@@
-52,8
+53,8
@@
TAG * swf_NextTag(TAG * t) { return t->next; }
TAG * swf_PrevTag(TAG * t) { return t->prev; }
int swf_GetFrameNo(TAG * t) { return t->frame; }
U16 swf_GetTagID(TAG * t) { return t->id; }
TAG * swf_PrevTag(TAG * t) { return t->prev; }
int swf_GetFrameNo(TAG * t) { return t->frame; }
U16 swf_GetTagID(TAG * t) { return t->id; }
-U32 swf_GetDataSize(TAG * t) { return t->len; }
-U8* swf_GetDataSizePtr(TAG * t) { return &(t->data[t->len]); }
+U32 swf_GetTagLen(TAG * t) { return t->len; }
+U8* swf_GetTagLenPtr(TAG * t) { return &(t->data[t->len]); }
U32 swf_GetTagPos(TAG * t) { return t->pos; }
// Basic Data Access Functions
U32 swf_GetTagPos(TAG * t) { return t->pos; }
// Basic Data Access Functions
@@
-354,6
+355,10
@@
int swf_SetMatrix(TAG * t,MATRIX * m)
{ swf_SetBits(t,1,1);
nbits = swf_CountBits(m->sx,0);
nbits = swf_CountBits(m->sy,nbits);
{ swf_SetBits(t,1,1);
nbits = swf_CountBits(m->sx,0);
nbits = swf_CountBits(m->sy,nbits);
+ if(nbits>=32) {
+ fprintf(stderr,"rfxswf: Error: matrix values too large\n");
+ nbits = 31;
+ }
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->sx,nbits);
swf_SetBits(t,m->sy,nbits);
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->sx,nbits);
swf_SetBits(t,m->sy,nbits);
@@
-364,6
+369,10
@@
int swf_SetMatrix(TAG * t,MATRIX * m)
{ swf_SetBits(t,1,1);
nbits = swf_CountBits(m->r0,0);
nbits = swf_CountBits(m->r1,nbits);
{ swf_SetBits(t,1,1);
nbits = swf_CountBits(m->r0,0);
nbits = swf_CountBits(m->r1,nbits);
+ if(nbits>=32) {
+ fprintf(stderr,"rfxswf: Error: matrix values too large\n");
+ nbits = 31;
+ }
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->r0,nbits);
swf_SetBits(t,m->r1,nbits);
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->r0,nbits);
swf_SetBits(t,m->r1,nbits);
@@
-371,6
+380,10
@@
int swf_SetMatrix(TAG * t,MATRIX * m)
nbits = swf_CountBits(m->tx,0);
nbits = swf_CountBits(m->ty,nbits);
nbits = swf_CountBits(m->tx,0);
nbits = swf_CountBits(m->ty,nbits);
+ if(nbits>=32) {
+ fprintf(stderr,"rfxswf: Error: matrix values too large\n");
+ nbits = 31;
+ }
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->tx,nbits);
swf_SetBits(t,m->ty,nbits);
swf_SetBits(t,nbits,5);
swf_SetBits(t,m->tx,nbits);
swf_SetBits(t,m->ty,nbits);
@@
-498,7
+511,6
@@
TAG * swf_InsertTag(TAG * after,U16 id) // updates frames, if nescessary
if (t)
{ memset(t,0x00,sizeof(TAG));
t->id = id;
if (t)
{ memset(t,0x00,sizeof(TAG));
t->id = id;
- t->writeBit = 0x80;
if (after)
{ t->frame = after->frame;
if (after)
{ t->frame = after->frame;
@@
-735,7
+747,7
@@
int swf_WriteSWF(int handle,SWF * swf) // Writes SWF to file, returns lengt
swf_SetU16(&t1,swf->frameRate);
swf_SetU16(&t1,swf->frameCount);
swf_SetU16(&t1,swf->frameRate);
swf_SetU16(&t1,swf->frameCount);
- l = swf_GetDataSize(&t1);
+ l = swf_GetTagLen(&t1);
swf->fileSize = l+len;
t1.len = 4; // bad & ugly trick !
swf_SetU32(&t1,swf->fileSize);
swf->fileSize = l+len;
t1.len = 4; // bad & ugly trick !
swf_SetU32(&t1,swf->fileSize);
@@
-763,7
+775,7
@@
int swf_WriteSWF(int handle,SWF * swf) // Writes SWF to file, returns lengt
return (int)swf->fileSize;
}
return (int)swf->fileSize;
}
-int WriteCGI(SWF * swf)
+int swf_WriteCGI(SWF * swf)
{ int len;
char s[1024];
{ int len;
char s[1024];