[Swfed-svn] swfed-svn [169] - parse/ build の頭に bitstream_align を追加

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2009年 7月 2日 (木) 00:31:31 JST


Revision: 169
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=169
Author:   yoya
Date:     2009-07-02 00:31:31 +0900 (Thu, 02 Jul 2009)

Log Message:
-----------
- parse/build の頭に bitstream_align を追加
- parse にエラー処理を追加

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


-------------- next part --------------
Modified: trunk/src/swf_styles_count.c
===================================================================
--- trunk/src/swf_styles_count.c	2009-07-01 15:30:23 UTC (rev 168)
+++ trunk/src/swf_styles_count.c	2009-07-01 15:31:31 UTC (rev 169)
@@ -4,13 +4,20 @@
 
 int
 swf_styles_count_parse(bitstream_t *bs, swf_styles_count_t *styles_count) {
+    int result;
+    bitstream_align(bs);
     styles_count->fill_bits_count = bitstream_getbits(bs, 4);
-    styles_count->line_bits_count = bitstream_getbits(bs, 4);
+    result = bitstream_getbits(bs, 4);
+    if (result == -1) {
+        return 1;
+    }
+    styles_count->line_bits_count = result;
     return 0;
 }
 
 int
 swf_styles_count_build(bitstream_t *bs, swf_styles_count_t *styles_count) {
+    bitstream_align(bs);
     bitstream_putbits(bs, styles_count->fill_bits_count, 4);
     bitstream_putbits(bs, styles_count->line_bits_count, 4);
     return 0;



Swfed-svn メーリングリストの案内
Zurück zum Archiv-Index