[Swfed-svn] swfed-svn [562] parse エラー時の処理を追加

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 4月 10日 (日) 01:13:28 JST


Revision: 562
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=562
Author:   yoya
Date:     2011-04-10 01:13:27 +0900 (Sun, 10 Apr 2011)

Log Message:
-----------
parse エラー時の処理を追加

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


-------------- next part --------------
Modified: trunk/src/swf_xrgb.c
===================================================================
--- trunk/src/swf_xrgb.c	2011-04-09 09:23:22 UTC (rev 561)
+++ trunk/src/swf_xrgb.c	2011-04-09 16:13:27 UTC (rev 562)
@@ -4,10 +4,15 @@
 
 int
 swf_xrgb_parse(bitstream_t *bs, swf_xrgb_t *color) {
+    int ret;
     (void) bitstream_getbyte(bs); // pad
     color->red   = bitstream_getbyte(bs);
     color->green = bitstream_getbyte(bs);
-    color->blue  = bitstream_getbyte(bs);
+    ret = = bitstream_getbyte(bs);
+    if (ret < 0) {
+        return 1;
+    }
+    color->blue = ret;
     return 0;
 }
 



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