X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=b063cc07f60c4e1c04cfbb5ae4c599bb2144e5c2;hb=66a03382aab040571f94b0861719753bda3ff8f1;hp=93f5db5d2d287b3faa34083ed9093c271b1caa9d;hpb=8d26cc0baf8f7d05e72bc7b8e5f1a6f7caa9f158;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index 93f5db5..b063cc0 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -204,17 +204,22 @@ U32 swf_GetBits(TAG * t,int nbits) if (!t->readBit) t->readBit = 0x80; while (nbits) { res<<=1; +#ifdef DEBUG_RFXSWF + if (t->pos>=t->len) + { fprintf(stderr,"GetBits() out of bounds: TagID = %i, pos=%d, len=%d\n",t->id, t->pos, t->len); + int i,m=t->len>10?10:t->len; + for(i=-1;idata[i]); + } + fprintf(stderr, "\n"); + return res; + } +#endif if (t->data[t->pos]&t->readBit) res|=1; t->readBit>>=1; nbits--; if (!t->readBit) { if (nbits) t->readBit = 0x80; - #ifdef DEBUG_RFXSWF - if (t->pos>=t->len) - { fprintf(stderr,"GetBits() out of bounds: TagID = %i\n",t->id); - return res; - } - #endif t->pos++; } } @@ -368,7 +373,12 @@ int swf_GetS30(TAG*tag) while(1) { U8 b = swf_GetU8(tag); nr++; - s|=(b&127)<len>10?10:t->len; + for(i=0;idata[i]); + } + fprintf(stderr, "\n"); + s|=(b&127)<=32) { if(b&64) {