OSDN Git Service

parse エラー時の処理を追加
authoryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Sat, 9 Apr 2011 16:13:27 +0000 (16:13 +0000)
committeryoya <yoya@7c90b180-03d5-4157-b861-58a559ae9d1e>
Sat, 9 Apr 2011 16:13:27 +0000 (16:13 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@562 7c90b180-03d5-4157-b861-58a559ae9d1e

src/swf_xrgb.c

index 138f07b..ffb55c2 100644 (file)
@@ -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;
 }