From dea7c7c2734bd5805e886f3773200e2e940cb573 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E3=82=88=E3=82=84?= Date: Thu, 23 Jun 2011 04:04:06 +0900 Subject: [PATCH] =?utf8?q?cid=5Flist=20=E3=81=AE=20realloc=20=E3=81=AE?= =?utf8?q?=E6=88=BB=E3=82=8A=E5=80=A4=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=20(=E5=A4=B1=E6=95=97=E3=81=97=E3=81=9F?= =?utf8?q?=E5=A0=B4=E5=90=88=E3=82=84=E3=83=9D=E3=82=A4=E3=83=B3=E3=82=BF?= =?utf8?q?=E3=81=8C=E5=A4=89=E3=82=8F=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88?= =?utf8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/swf_tag_shape.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/swf_tag_shape.c b/src/swf_tag_shape.c index f93f3d1..7dc1131 100644 --- a/src/swf_tag_shape.c +++ b/src/swf_tag_shape.c @@ -219,6 +219,7 @@ swf_tag_shape_bitmap_get_refcid_list(swf_tag_t *tag, int *cid_list_num) { return NULL; // Illegal!!! } switch (fill_style->type) { + void *tmp; case 0x40: // tilled bitmap fill with smoothed edges case 0x41: // clipped bitmap fill with smoothed edges case 0x42: // tilled bitmap fill with hard edges @@ -226,7 +227,13 @@ 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; - realloc(cid_list, cid_list_alloc); + tmp = realloc(cid_list, 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); + return NULL; + } + cid_list = tmp; } cid_list[*cid_list_num] = fill_style->bitmap.bitmap_ref; *cid_list_num = (*cid_list_num) + 1; -- 2.11.0