search for: swfdec_bits_get_u8

Displaying 20 results from an estimated 61 matches for "swfdec_bits_get_u8".

Did you mean: swfdec_bits_get_u16
2007 Aug 13
0
2 commits - libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h
...Button *button; char *script_name; - id = swfdec_bits_get_u16 (bits); + id = swfdec_bits_get_u16 (&s->b); button = swfdec_swf_decoder_create_character (s, id, SWFDEC_TYPE_BUTTON); if (!button) return SWFDEC_STATUS_OK; SWFDEC_LOG (" ID: %d", id); - flags = swfdec_bits_get_u8 (bits); - if (flags & 0x01) - button->menubutton = TRUE; - offset = swfdec_bits_get_u16 (bits); - - SWFDEC_LOG (" flags = %d", flags); - SWFDEC_LOG (" offset = %d", offset); - - while (swfdec_bits_peek_u8 (bits)) { - int reserved; + reserved = swfdec_bits_ge...
2007 Sep 17
0
2 commits - libswfdec/swfdec_bits.c
...14 @@ swfdec_bits_get_rgba (SwfdecBits * bits) } static inline SwfdecGradient * -swfdec_bits_do_get_gradient (SwfdecBits *bits, gboolean alpha) +swfdec_bits_do_get_gradient (SwfdecBits *bits, gboolean alpha, gboolean morph) { SwfdecGradient *grad; guint i, n_gradients; n_gradients = swfdec_bits_get_u8 (bits); + if (morph) + n_gradients *= 2; grad = g_malloc (sizeof (SwfdecGradient) + sizeof (SwfdecGradientEntry) * (MAX (n_gradients, 1) - 1)); for (i = 0; i < n_gradients && swfdec_bits_left (bits); i++) { @@ -625,35 +627,19 @@ swfdec_bits_do_get_gradient (SwfdecBits...
2007 Feb 15
0
8 commits - libswfdec/swfdec_bits.h libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_tag.c libswfdec/swfdec_text.c libswfdec/swfdec_text.h test/swfedit_token.c test/various
...font (SwfdecSwfDecoder * } static void -get_kerning_record (SwfdecBits * bits, int wide_codes) +swfdec_font_parse_kerning_table (SwfdecSwfDecoder *s, SwfdecFont *font, gboolean wide_codes) { - if (wide_codes) { - swfdec_bits_get_u16 (bits); - swfdec_bits_get_u16 (bits); - } else { - swfdec_bits_get_u8 (bits); - swfdec_bits_get_u8 (bits); + SwfdecBits *bits; + guint n_kernings, i; + + n_kernings = swfdec_bits_get_u16 (bits); + for (i = 0; i < n_kernings; i++) { + if (wide_codes) { + swfdec_bits_get_u16 (bits); + swfdec_bits_get_u16 (bits); + } else { + swfdec_bits_g...
2007 Apr 22
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_movie.c
...0 break out of gradient loop when no more bits are available diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index 0f7e4c9..7077cdc 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -585,11 +585,15 @@ swfdec_bits_get_gradient (SwfdecBits * b n_gradients = swfdec_bits_get_u8 (bits); grad = g_malloc (sizeof (SwfdecGradient) + sizeof (SwfdecGradientEntry) * (n_gradients - 1)); - grad->n_gradients = n_gradients; - for (i = 0; i < n_gradients; i++) { + for (i = 0; i < n_gradients && swfdec_bits_left (bits); i++) { grad->array[i].ratio...
2007 Aug 13
0
Branch 'vivi' - 24 commits - configure.ac libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h vivified/core vivified/dock vivified/ui
...Button *button; char *script_name; - id = swfdec_bits_get_u16 (bits); + id = swfdec_bits_get_u16 (&s->b); button = swfdec_swf_decoder_create_character (s, id, SWFDEC_TYPE_BUTTON); if (!button) return SWFDEC_STATUS_OK; SWFDEC_LOG (" ID: %d", id); - flags = swfdec_bits_get_u8 (bits); - if (flags & 0x01) - button->menubutton = TRUE; - offset = swfdec_bits_get_u16 (bits); - - SWFDEC_LOG (" flags = %d", flags); - SWFDEC_LOG (" offset = %d", offset); - - while (swfdec_bits_peek_u8 (bits)) { - int reserved; + reserved = swfdec_bits_ge...
2007 Feb 16
0
11 commits - libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h test/.gitignore test/trace
...ean v2 = (action == 0x8e); + guint flags = 0; + guint8 *preloads = NULL; swfdec_bits_init_data (&bits, data, len); function_name = swfdec_bits_get_string (&bits); @@ -1446,8 +1448,8 @@ swfdec_action_define_function (JSContext return JS_FALSE; if (v2) { fun->nvars = swfdec_bits_get_u8 (&bits); - script->flags = swfdec_bits_get_u16 (&bits); - script->preloads = g_new0 (guint8, n_args); + flags = swfdec_bits_get_u16 (&bits); + preloads = g_new0 (guint8, n_args); } else { fun->nvars = 4; } @@ -1462,9 +1464,10 @@ swfdec_action_define_funct...
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...r * @@ -352,6 +365,7 @@ swfdec_action_print_push (guint action, break; case 7: /* 32bit int */ g_string_append_printf (string, "%u", swfdec_bits_get_u32 (&bits)); + break; case 8: /* 8bit ConstantPool address */ g_string_append_printf (string, "Pool %u", swfdec_bits_get_u8 (&bits)); break; @@ -450,7 +464,7 @@ static const SwfdecActionSpec actions[25 [0x15] = { "StringExtract", NULL }, [0x17] = { "Pop", NULL }, [0x18] = { "ToInteger", NULL }, - [0x1c] = { "GetVariable", NULL }, + [0x1c] = { "GetVariable&quo...
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...r * +swfdec_debugger_print_push (ScriptParser *parser, const guint8 *data, guint len) +{ + gboolean first = TRUE; + SwfdecBits bits; + GString *string = g_string_new ("Push"); + + swfdec_bits_init_data (&bits, data, len); + while (swfdec_bits_left (&bits)) { + guint type = swfdec_bits_get_u8 (&bits); + if (first) + g_string_append (string, " "); + else + g_string_append (string, ", "); + first = FALSE; + switch (type) { + case 0: /* string */ + { + const char *s = swfdec_bits_skip_string (&bits); + if (!s) { + g_string_free...
2007 Oct 31
0
5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_audio.c libswfdec/swfdec_sound.c libswfdec/swfdec_xml.c
...s_in_point; - guint i, j, n_envelopes; - GArray *envelopes; + guint i, j; SwfdecSound *sound; SwfdecSoundChunk *chunk; @@ -352,47 +351,29 @@ swfdec_sound_parse_chunk (SwfdecSwfDecoder *s, SwfdecBits *b, int id) chunk->loop_count = 1; } if (has_envelope) { - n_envelopes = swfdec_bits_get_u8 (b); - if (n_envelopes > 0) { - envelopes = g_array_sized_new (FALSE, FALSE, - sizeof (SwfdecSoundEnvelope), n_envelopes); - } + chunk->n_envelopes = swfdec_bits_get_u8 (b); + chunk->envelope = g_new0 (SwfdecSoundEnvelope, chunk->n_envelopes); SWFDEC_LOG ("...
2007 Feb 02
0
Branch 'interpreter' - 6 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_compiler.c libswfdec/swfdec_sprite.c test/swfdec-extract.c
...ot;", s); push_string (state, s); break; @@ -1300,7 +1304,7 @@ swfdec_compile (SwfdecPlayer *player, Sw name = "Unnamed script"; compile_state_init (player->jscx, bits, version, &state); SWFDEC_INFO ("Creating new script in frame"); - while ((action = swfdec_bits_get_u8 (bits))) { + while (swfdec_bits_left (bits) && (action = swfdec_bits_get_u8 (bits))) { if (action & 0x80) { len = swfdec_bits_get_u16 (bits); } else { diff-tree b144bf362ce73d4a739663f8a28261eb317f45be (from c93579e07522e43a3d4d3ba9927d50ee74d5d5cb) Author: Benjamin Ot...
2007 Mar 29
0
libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_audio_flv.h libswfdec/swfdec_audio_stream.h libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_cache.c
...unsigned long r = 0; @@ -198,7 +198,7 @@ swfdec_bits_getsbits (SwfdecBits * b, un return r; } -unsigned int +guint swfdec_bits_peek_u8 (SwfdecBits * b) { SWFDEC_BYTES_CHECK (b, 1); @@ -206,7 +206,7 @@ swfdec_bits_peek_u8 (SwfdecBits * b) return *b->ptr; } -unsigned int +guint swfdec_bits_get_u8 (SwfdecBits * b) { SWFDEC_BYTES_CHECK (b, 1); @@ -214,10 +214,10 @@ swfdec_bits_get_u8 (SwfdecBits * b) return *b->ptr++; } -unsigned int +guint swfdec_bits_get_u16 (SwfdecBits * b) { - unsigned int r; + guint r; SWFDEC_BYTES_CHECK (b, 2); @@ -240,10 +240,10 @@ swfdec_bits_g...
2007 May 01
0
2 commits - libswfdec/swfdec_bits.c
...lt; (unsigned) 0 if n_gradients was 0, that could happen diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index b74846e..c8a5062 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -587,7 +587,7 @@ swfdec_bits_get_gradient (SwfdecBits * b n_gradients = swfdec_bits_get_u8 (bits); grad = g_malloc (sizeof (SwfdecGradient) + - sizeof (SwfdecGradientEntry) * (n_gradients - 1)); + sizeof (SwfdecGradientEntry) * (MAX (n_gradients, 1) - 1)); for (i = 0; i < n_gradients && swfdec_bits_left (bits); i++) { grad->array[i].ratio = swfdec_bits_...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...*stack = cx->frame->stack; SwfdecBits bits; - guint stackspace = cx->fp->spend - cx->fp->sp; swfdec_bits_init_data (&bits, data, len); - while (swfdec_bits_left (&bits) && stackspace-- > 0) { + while (swfdec_bits_left (&bits)) { guint type = swfdec_bits_get_u8 (&bits); SWFDEC_LOG ("push type %u", type); + swfdec_as_stack_ensure_left (stack, 1); switch (type) { case 0: /* string */ { const char *s = swfdec_bits_skip_string (&bits); - if (!swfdec_action_push_string (cx, s)) - return JS_FALSE; + if (s == N...
2007 Apr 17
0
15 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_edittext.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sprite.c
.....3aa5053 100644 --- a/libswfdec/swfdec_shape.c +++ b/libswfdec/swfdec_shape.c @@ -338,7 +338,6 @@ swfdec_shape_add_styles (SwfdecSwfDecode g_ptr_array_add (shape->fills, pattern); } - swfdec_bits_syncbits (bits); shape->lines_offset = shape->lines->len; n_line_styles = swfdec_bits_get_u8 (bits); if (n_line_styles == 0xff) { @@ -349,7 +348,6 @@ swfdec_shape_add_styles (SwfdecSwfDecode g_ptr_array_add (shape->lines, parse_stroke (s)); } - swfdec_bits_syncbits (bits); shape->n_fill_bits = swfdec_bits_getbits (bits, 4); shape->n_line_bits = swfdec_bits_getb...
2007 Apr 17
0
Branch 'as' - 17 commits - libswfdec/jpeg libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_image.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c libswfdec/swfdec_shape.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite.c
.....3aa5053 100644 --- a/libswfdec/swfdec_shape.c +++ b/libswfdec/swfdec_shape.c @@ -338,7 +338,6 @@ swfdec_shape_add_styles (SwfdecSwfDecode g_ptr_array_add (shape->fills, pattern); } - swfdec_bits_syncbits (bits); shape->lines_offset = shape->lines->len; n_line_styles = swfdec_bits_get_u8 (bits); if (n_line_styles == 0xff) { @@ -349,7 +348,6 @@ swfdec_shape_add_styles (SwfdecSwfDecode g_ptr_array_add (shape->lines, parse_stroke (s)); } - swfdec_bits_syncbits (bits); shape->n_fill_bits = swfdec_bits_getbits (bits, 4); shape->n_line_bits = swfdec_bits_getb...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...unsigned long r = 0; @@ -198,7 +198,7 @@ swfdec_bits_getsbits (SwfdecBits * b, un return r; } -unsigned int +guint swfdec_bits_peek_u8 (SwfdecBits * b) { SWFDEC_BYTES_CHECK (b, 1); @@ -206,7 +206,7 @@ swfdec_bits_peek_u8 (SwfdecBits * b) return *b->ptr; } -unsigned int +guint swfdec_bits_get_u8 (SwfdecBits * b) { SWFDEC_BYTES_CHECK (b, 1); @@ -214,10 +214,10 @@ swfdec_bits_get_u8 (SwfdecBits * b) return *b->ptr++; } -unsigned int +guint swfdec_bits_get_u16 (SwfdecBits * b) { - unsigned int r; + guint r; SWFDEC_BYTES_CHECK (b, 2); @@ -240,10 +240,10 @@ swfdec_bits_g...
2007 Oct 26
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c
...catch_size = swfdec_bits_get_u16 (&bits); - finally_size = swfdec_bits_get_u16 (&bits); + try_data->catch_size = swfdec_bits_get_u16 (&bits); + try_data->finally_size = swfdec_bits_get_u16 (&bits); + try_data->start = data + len + try_size; - if (use_register) { - swfdec_bits_get_u8 (&bits); + if (try_data->use_register) { + try_data->register_number = swfdec_bits_get_u8 (&bits); } else { - swfdec_bits_get_string_with_version (&bits, cx->version); + try_data->variable_name = + swfdec_bits_get_string_with_version (&bits, cx->vers...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...tion, const guint8 *data, guint len) +{ + /* FIXME: supply API for this */ + SwfdecBits bits; + guint stackspace = cx->fp->spend - cx->fp->sp; + + swfdec_bits_init_data (&bits, data, len); + while (swfdec_bits_left (&bits) && stackspace-- > 0) { + guint type = swfdec_bits_get_u8 (&bits); + SWFDEC_LOG ("push type %u", type); + switch (type) { + case 0: /* string */ + { + const char *s = swfdec_bits_skip_string (&bits); + if (!swfdec_action_push_string (cx, s)) + return JS_FALSE; + break; + } + case 1: /* float */ + { + double d...
2007 Feb 06
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c libswfdec/swfdec_sprite.c test/dump.c
...f79 Author: Benjamin Otte <otte@gnome.org> Date: Sun Feb 4 18:39:22 2007 +0100 Merge branch 'master' into interpreter Conflicts: libswfdec/swfdec_image.c diff --cc libswfdec/swfdec_bits.c index f3ea7c4,5013e49..21172f2 @@@ -482,13 -450,13 +482,13 @@@ g = swfdec_bits_get_u8 (bits); b = swfdec_bits_get_u8 (bits); - return SWF_COLOR_COMBINE (r, g, b, 0xff); + return SWFDEC_COLOR_COMBINE (r, g, b, 0xff); } -unsigned int +SwfdecColor swfdec_bits_get_rgba (SwfdecBits * bits) { - int r, g, b, a; + unsigned int r, g, b, a; r = swfdec_bits_get...
2007 Jan 24
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_script.c test/swfdec_out.c test/swfdec_out.h test/swfedit_tag.c test/swfedit_token.c test/swfedit_token.h
...s.c index 1a7e402..418e9eb 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -471,10 +471,10 @@ swfdec_bits_get_string_length (SwfdecBit return ret; } -unsigned int +SwfdecColor swfdec_bits_get_color (SwfdecBits * bits) { - int r, g, b; + unsigned int r, g, b; r = swfdec_bits_get_u8 (bits); g = swfdec_bits_get_u8 (bits); @@ -483,10 +483,10 @@ swfdec_bits_get_color (SwfdecBits * bits return SWF_COLOR_COMBINE (r, g, b, 0xff); } -unsigned int +SwfdecColor swfdec_bits_get_rgba (SwfdecBits * bits) { - int r, g, b, a; + unsigned int r, g, b, a; r = swfdec_bits_get_...