[Swfed-svn] swfed-svn [175] swf_fill_style_parse で失敗したら処理を終えるように修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 28日 (金) 01:20:13 JST


Revision: 175
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=175
Author:   yoya
Date:     2009-08-28 01:20:13 +0900 (Fri, 28 Aug 2009)

Log Message:
-----------
swf_fill_style_parse で失敗したら処理を終えるように修正

Modified Paths:
--------------
    trunk/src/swf_fill_style_array.c


-------------- next part --------------
Modified: trunk/src/swf_fill_style_array.c
===================================================================
--- trunk/src/swf_fill_style_array.c	2009-08-27 16:18:05 UTC (rev 174)
+++ trunk/src/swf_fill_style_array.c	2009-08-27 16:20:13 UTC (rev 175)
@@ -8,14 +8,22 @@
                            swf_fill_style_array_t *fill_style_array,
                            swf_tag_t *tag) {
     int i;
+    int result;
+
     fill_style_array->count = bitstream_getbyte(bs);
+    
     if ((tag->tag != 2) && // ! DefineShape
         (fill_style_array->count == 255)) {
         fill_style_array->count = bitstream_getbytesLE(bs, 2);
     }
     fill_style_array->fill_style = calloc(fill_style_array->count, sizeof(swf_fill_style_t));
     for (i = 0 ; i < fill_style_array->count ; i++) {
-        swf_fill_style_parse(bs, &(fill_style_array->fill_style[i]), tag);
+        result = swf_fill_style_parse(bs, &(fill_style_array->fill_style[i]), tag);
+        if (result) {
+            fprintf(stderr, "swf_fill_style_array_parse: swf_fill_style_parse failed i=%d\n", i);
+            fill_style_array->count = i;
+            return 1;
+        }
     }
     return 0;
 }



Swfed-svn メーリングリストの案内
Back to archive index