svnno****@sourc*****
svnno****@sourc*****
2008年 9月 11日 (木) 10:46:24 JST
Revision: 47 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=swfed&view=rev&rev=47 Author: yoya Date: 2008-09-11 10:46:24 +0900 (Thu, 11 Sep 2008) Log Message: ----------- 変数名の変更 (old_buff -> old_buff_ref) 後で間違えて free されない為 Modified Paths: -------------- src/swf_tag_lossless.c -------------- next part -------------- Modified: src/swf_tag_lossless.c =================================================================== --- src/swf_tag_lossless.c 2008-09-11 01:32:14 UTC (rev 46) +++ src/swf_tag_lossless.c 2008-09-11 01:46:24 UTC (rev 47) @@ -33,7 +33,7 @@ bitstream_t *bs, *bs2; (void) swf; unsigned long i; - unsigned char *tmp_buff, *old_buff; + unsigned char *tmp_buff, *old_buff_ref; unsigned long origsize, old_size, offset; int result; @@ -61,9 +61,9 @@ origsize = bytes_per_color * swf_tag_lossless->colormap_count + indices_len; tmp_buff = malloc(origsize); offset = bitstream_getbytepos(bs); - old_buff = bitstream_buffer(bs, offset); + old_buff_ref = bitstream_buffer(bs, offset); old_size = bitstream_length(bs) - offset; - result = uncompress(tmp_buff, &origsize, old_buff, old_size); + result = uncompress(tmp_buff, &origsize, old_buff_ref, old_size); if (indices_len != origsize - bytes_per_color * swf_tag_lossless->colormap_count) { fprintf(stderr, "swf_tag_lossless_create_detail: indices_len != origsize - %d * swf_tag_lossless->colormap_count at line(%d)\n", bytes_per_color, __LINE__); @@ -110,9 +110,9 @@ origsize = 4 * bitmap_count; // xrgb or argb (4 bytes) tmp_buff = malloc(origsize); offset = bitstream_getbytepos(bs); - old_buff = bitstream_buffer(bs, offset); + old_buff_ref = bitstream_buffer(bs, offset); old_size = bitstream_length(bs) - offset; - result = uncompress(tmp_buff, &origsize, old_buff, old_size); + result = uncompress(tmp_buff, &origsize, old_buff_ref, old_size); if (result != Z_OK) { if (result == Z_MEM_ERROR) { fprintf(stderr, "swf_tag_lossless_create_detail: uncompress: Z_MEM_ERROR: can't malloc (origsize=%lu, old_size=%lu) at line(%d)\n", @@ -180,7 +180,7 @@ bitstream_t *bs, *bs2; unsigned char *data; unsigned long i; - unsigned char *tmp_buff, *old_buff; + unsigned char *tmp_buff, *old_buff_ref; unsigned long compsize, old_size; (void) swf; *length = 0; @@ -205,11 +205,11 @@ } } indices_len = ((swf_tag_lossless->width + 3) & -4) * swf_tag_lossless->height; - old_buff = bitstream_buffer(bs2, 0); + old_buff_ref = bitstream_buffer(bs2, 0); old_size = bitstream_length(bs2); bitstream_close(bs2); tmp_buff = malloc(old_size); // too enough size - compress(tmp_buff, &compsize, old_buff, old_size); + compress(tmp_buff, &compsize, old_buff_ref, old_size); bitstream_putstring(bs, tmp_buff, compsize); free(tmp_buff); } else { @@ -228,12 +228,12 @@ swf_argb_build(bs2, argb); } } - old_buff = bitstream_buffer(bs2, 0); + old_buff_ref = bitstream_buffer(bs2, 0); old_size = bitstream_length(bs2); bitstream_close(bs2); compsize = old_size; // too enough size tmp_buff = malloc(compsize); - compress(tmp_buff, &compsize, old_buff, old_size); + compress(tmp_buff, &compsize, old_buff_ref, old_size); bitstream_putstring(bs, tmp_buff, compsize); free(tmp_buff); }