OSDN Git Service

realloc size is too short. must be multiplied by sizeof type.
authorよや <yoya@awm.jp>
Mon, 16 Apr 2012 18:46:34 +0000 (03:46 +0900)
committerよや <yoya@awm.jp>
Mon, 16 Apr 2012 18:46:34 +0000 (03:46 +0900)
src/swf_tag_button.c
src/swf_tag_shape.c

index dd0ea9e..e32f2c8 100644 (file)
@@ -140,7 +140,7 @@ swf_tag_button_character_get_refcid_list(swf_tag_t *tag, int *cid_list_num) {
             if (cid_list_alloc <= *cid_list_num) {
                 int *tmp;
                 cid_list_alloc *= 2;
-                tmp = realloc(cid_list, cid_list_alloc);
+                tmp = realloc(cid_list, sizeof(int) * cid_list_alloc);
                 if (tmp == NULL) {
                     fprintf(stderr, "swf_tag_shape_bitmap_get_refcid_list: Can't realloc memory (%p, %d)\n", cid_list, cid_list_alloc);
                     free(cid_list);
index 471a085..a1165f2 100644 (file)
@@ -227,7 +227,7 @@ swf_tag_shape_bitmap_get_refcid_list(swf_tag_t *tag, int *cid_list_num) {
                 if (fill_style->bitmap.bitmap_ref != 0xffff) {
                     if (cid_list_alloc <= *cid_list_num) {
                         cid_list_alloc *= 2;
-                        tmp = realloc(cid_list, cid_list_alloc);
+                        tmp = realloc(cid_list, sizeof(int) * cid_list_alloc);
                         if (tmp == NULL) {
                             fprintf(stderr, "swf_tag_shape_bitmap_get_refcid_list: Can't realloc memory (%p, %d)\n", cid_list, cid_list_alloc);
                             free(cid_list);