OSDN Git Service

swf_morph_shape_with_style_parse のエラー処理を追加
authoryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Thu, 7 Apr 2011 07:04:47 +0000 (07:04 +0000)
committeryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Thu, 7 Apr 2011 07:04:47 +0000 (07:04 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@536 7c90b180-03d5-4157-b861-58a559ae9d1e

src/swf_morph_shape_with_style.c
src/swf_tag_shape.c

index a39b6fd..c6d3c23 100644 (file)
@@ -6,13 +6,23 @@ int
 swf_morph_shape_with_style_parse(bitstream_t *bs,
                                  swf_morph_shape_with_style_t *morph_shape_with_style,
                                  swf_tag_t *tag) {
+    int ret;
     swf_styles_parse(bs, &(morph_shape_with_style->styles), tag);
-    swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records), tag);
+    ret = swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records), tag);
+    if (ret) {
+        fprintf(stderr, "swf_morph_shape_with_style_parse: swf_shape_record_parse shape_records failed\n");
+        return ret;
+    }
+    
     bitstream_align(bs);
     swf_styles_count_parse(bs, &(morph_shape_with_style->styles_count));
-    swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records_morph),
-                           tag);
-    return 0;
+    ret = swf_shape_record_parse(bs, &(morph_shape_with_style->shape_records_morph),
+                                 tag);
+    if (ret) {
+        fprintf(stderr, "swf_morph_shape_with_style_parse: swf_shape_record_parse shape_records_morph failed\n");
+        return ret;
+    }
+    return ret;
 }
 
 int
index f44f2d2..224a61d 100644 (file)
@@ -110,7 +110,12 @@ swf_tag_shape_input_detail(swf_tag_t *tag, struct swf_object_ *swf) {
     }
     if (swf_tag_shape->is_morph) {
         swf_tag_shape->offset_morph = bitstream_getbytesLE(bs, 4);
-        swf_morph_shape_with_style_parse(bs, &swf_tag_shape->morph_shape_with_style, tag);
+        ret = swf_morph_shape_with_style_parse(bs, &swf_tag_shape->morph_shape_with_style, tag);
+        if (ret) {
+            fprintf(stderr, "ERROR: swf_tag_shape_input_detail: swf_shape_with_style_parse swf_tag_shape->morph_shape_with_style failed. shape_id=%d\n", swf_tag_shape->shape_id);
+               bitstream_close(bs);
+            return ret;
+        }
     } else {
         ret = swf_shape_with_style_parse(bs, &swf_tag_shape->shape_with_style, tag);
         if (ret) {