X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=4643551695a7c0348d8e1c75ba1e19bcf1f6f900;hb=21630ba77e5b648554e06dff2a5117811d30b80b;hp=4f6b3101c799133fd90d58e2c44490f212100213;hpb=c53aa61d2d061e0fa15f6c8a4fe945766a2733d1;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 4f6b310..4643551 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -561,7 +561,8 @@ static void tag_init_source(struct jpeg_decompress_struct *cinfo) static boolean tag_fill_input_buffer(struct jpeg_decompress_struct *cinfo) { TAG *tag = (TAG *) cinfo->client_data; - if (tag->data[tag->pos + 0] == 0xff && + if (tag->pos + 4 <= tag->len && + tag->data[tag->pos + 0] == 0xff && tag->data[tag->pos + 1] == 0xd9 && tag->data[tag->pos + 2] == 0xff && tag->data[tag->pos + 3] == 0xd8) { @@ -1181,9 +1182,15 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali int has_alpha = swf_ImageHasAlpha(mem,width,height); /* try lossless image */ + +#ifdef NO_LOSSLESS + tag1 = swf_InsertTag(0, /*ST_DEFINEBITSLOSSLESS1/2*/0); + tag1->len = 0x7fffffff; +#else tag1 = swf_InsertTag(0, /*ST_DEFINEBITSLOSSLESS1/2*/0); swf_SetU16(tag1, bitid); swf_SetLosslessImage(tag1, mem, width, height); +#endif #if defined(HAVE_JPEGLIB) /* try jpeg image */ @@ -1399,12 +1406,12 @@ static void blurImage(RGBA*src, int width, int height, int r) } int range = r*e/2; - RGBA*dest = malloc(sizeof(RGBA)*width*height); + RGBA*tmp = malloc(sizeof(RGBA)*width*height); int y; for(y=0;y