search for: swfdec_bits_left

Displaying 20 results from an estimated 51 matches for "swfdec_bits_left".

2007 Apr 22
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_movie.c
...amp;save_bits, size); swfdec_shape_get_recs (s, shape, swfdec_pattern_parse, swfdec_stroke_parse); swfdec_bits_syncbits (&s->b); - if (swfdec_bits_skip_bytes (&save_bits, size) != size) { - SWFDEC_ERROR ("invalid offset value, not enough bytes available"); - } - if (swfdec_bits_left (&save_bits) != swfdec_bits_left (&s->b)) { - SWFDEC_WARNING ("parsing shape did use %d bytes too much\n", - (swfdec_bits_left (&save_bits) - swfdec_bits_left (&s->b)) / 8); - /* we trust the offsets here */ - s->b = save_bits; + if (swfdec_bits_left (&a...
2007 Aug 13
0
2 commits - libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h
...reserved); + SWFDEC_LOG (" menu = %d", button->menubutton); + SWFDEC_LOG (" length of region = %d", length); + + if (length) + swfdec_bits_init_bits (&bits, &s->b, length > 2 ? length - 2 : 0); + else + swfdec_bits_init_bits (&bits, &s->b, swfdec_bits_left (&s->b) / 8); + while (swfdec_bits_peek_u8 (&bits)) { guint character; guint depth; guint states; + gboolean blend_mode, has_filters; SwfdecContent *content; - swfdec_bits_syncbits (bits); - reserved = swfdec_bits_getbits (bits, 4); - states = swfdec_bi...
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...ts_get_buffer (from, length)); diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index ff863cc..46b0581 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -32,6 +32,25 @@ #include "swfdec_rect.h" +#define SWFDEC_BITS_CHECK(b,n) G_STMT_START { \ + if (swfdec_bits_left(b) < (n)) { \ + SWFDEC_ERROR ("reading past end of buffer"); \ + b->ptr = b->end; \ + b->idx = 0; \ + return 0; \ + } \ +}G_STMT_END +#define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \ + g_assert (b->end >= b->ptr); \ + g_assert (b->idx == 0); \ + if...
2007 Feb 02
0
Branch 'interpreter' - 6 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_compiler.c libswfdec/swfdec_sprite.c test/swfdec-extract.c
...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 Otte <otte@gnome.org> Date: Fri...
2007 Sep 17
0
2 commits - libswfdec/swfdec_bits.c
...orph) { 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 SwfdecGradient * swfdec_bits_get_gradient (SwfdecBits * bits) { - return swfdec_bits_do_get_gradient (bits, FALSE); + return swfdec_bits_do_get_gradient (bits, FALSE, FALSE); } SwfdecGradient * swfdec_bits_get_g...
2007 Apr 26
0
4 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h NEWS README
...10:57:17 2007 +0200 constify const functions (James A. Morrison) diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index 7077cdc..b74846e 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -125,7 +125,7 @@ swfdec_bits_init_data (SwfdecBits *bits, } guint -swfdec_bits_left (SwfdecBits *b) +swfdec_bits_left (const SwfdecBits *b) { if (b->ptr == NULL) return 0; @@ -179,7 +179,7 @@ swfdec_bits_getbits (SwfdecBits * b, gui } guint -swfdec_bits_peekbits (SwfdecBits * b, guint n) +swfdec_bits_peekbits (const SwfdecBits * b, guint n) { SwfdecBits tmp = *...
2007 Feb 15
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_shape.c libswfdec/swfdec_tag.c
...coder SWFDEC_INFO ("sprite parsing at %d, tag %d %s, length %d", parse.ptr - parse.buffer->data, tag, swfdec_swf_decoder_get_tag_name (tag), tag_len); - //SWFDEC_DEBUG ("tag %d %s", tag, swfdec_decoder_get_tag_name (tag)); - if (tag_len * 8 > swfdec_bits_left (&parse)) { - SWFDEC_ERROR ("tag claims to be %u bytes long, but only %u bytes remaining", - tag_len, swfdec_bits_left (&parse) / 8); - break; - } else if (tag_len > 0) { - buffer = swfdec_buffer_new_subbuffer (parse.buffer, - parse.ptr - parse.buff...
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
...ibswfdec/swfdec_root_sprite.c +++ b/libswfdec/swfdec_root_sprite.c @@ -117,7 +117,7 @@ tag_func_export_assets (SwfdecSwfDecoder count = swfdec_bits_get_u16 (bits); SWFDEC_LOG ("exporting %u assets", count); - for (i = 0; i < count; i++) { + for (i = 0; i < count && swfdec_bits_left (bits); i++) { guint id; SwfdecCharacter *object; char *name; diff-tree 4ecf6f08ab585cbf8089373cb6535d5e3e3493fc (from 09b659302736f9b00db64a1586703de7fe8f7344) Author: Benjamin Otte <otte@gnome.org> Date: Tue Apr 17 12:40:39 2007 +0200 break out of loop if no more bits...
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
...ibswfdec/swfdec_root_sprite.c +++ b/libswfdec/swfdec_root_sprite.c @@ -117,7 +117,7 @@ tag_func_export_assets (SwfdecSwfDecoder count = swfdec_bits_get_u16 (bits); SWFDEC_LOG ("exporting %u assets", count); - for (i = 0; i < count; i++) { + for (i = 0; i < count && swfdec_bits_left (bits); i++) { guint id; SwfdecCharacter *object; char *name; diff-tree 4ecf6f08ab585cbf8089373cb6535d5e3e3493fc (from 09b659302736f9b00db64a1586703de7fe8f7344) Author: Benjamin Otte <otte@gnome.org> Date: Tue Apr 17 12:40:39 2007 +0200 break out of loop if no more bits...
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
.../libswfdec/swfdec_script.c @@ -29,6 +29,7 @@ #include <string.h> #include "swfdec_decoder.h" +#include "swfdec_js.h" #include "swfdec_movie.h" #include "swfdec_root_movie.h" @@ -305,6 +306,18 @@ swfdec_action_push (JSContext *cx, guint return swfdec_bits_left (&bits) ? JS_TRUE : JS_FALSE; } +static JSBool +swfdec_action_get_variable (JSContext *cx, guint action, const guint8 *data, guint len) +{ + const char *s; + + s = swfdec_js_to_string (cx, cx->fp->sp[-1]); + if (s == NULL) + return JS_FALSE; + cx->fp->sp[-1] = swfdec_js_ev...
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
...reserved); + SWFDEC_LOG (" menu = %d", button->menubutton); + SWFDEC_LOG (" length of region = %d", length); + + if (length) + swfdec_bits_init_bits (&bits, &s->b, length > 2 ? length - 2 : 0); + else + swfdec_bits_init_bits (&bits, &s->b, swfdec_bits_left (&s->b) / 8); + while (swfdec_bits_peek_u8 (&bits)) { guint character; guint depth; guint states; + gboolean blend_mode, has_filters; SwfdecContent *content; - swfdec_bits_syncbits (bits); - reserved = swfdec_bits_getbits (bits, 4); - states = swfdec_bi...
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
...DEC_LOG ("n_line_bits = %d", shape->n_line_bits); + + swfdec_shape_get_recs (s, shape); + swfdec_bits_syncbits (&s->b); + if (swfdec_bits_skip_bytes (&save_bits, size) != size) { + SWFDEC_ERROR ("invalid offset value, not enough bytes available"); + } + if (swfdec_bits_left (&save_bits) != swfdec_bits_left (&s->b)) { + SWFDEC_WARNING ("parsing shape did use %d bytes too much\n", + (swfdec_bits_left (&save_bits) - swfdec_bits_left (&s->b)) / 8); + /* we trust the offsets here */ + s->b = save_bits; + } +} + int tag_func_de...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...guint action, const guint8 *data, guint try_data->register_number = swfdec_bits_get_u8 (&bits); } else { try_data->variable_name = - swfdec_bits_get_string_with_version (&bits, cx->version); + swfdec_bits_get_string (&bits, cx->version); } if (swfdec_bits_left (&bits)) { @@ -2855,7 +2855,7 @@ swfdec_action_print_define_function (guint action, const guint8 *data, guint len string = g_string_new (v2 ? "DefineFunction2 " : "DefineFunction "); swfdec_bits_init_data (&bits, data, len); /* FIXME: version! */ - function_nam...
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
...(SwfdecAsContext *cx, guint action, const guint8 *data, guint len) { - /* FIXME: supply API for this */ + SwfdecAsStack *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 cha...
2007 Nov 28
0
59 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_event.c
...flags = swfdec_bits_get_u8 (&tmp); gid = swfdec_bits_get_u16 (&tmp); swfdec_bits_get_u16 (&tmp); - swfdec_bits_get_matrix (&tmp, &matrix, &inverse); + swfdec_bits_get_matrix (&tmp, &matrix, NULL); buffer = swfdec_bits_get_buffer (&s->b, (swfdec_bits_left (&s->b) - swfdec_bits_left (&tmp)) / 8); if (buffer == NULL) break; @@ -272,7 +274,7 @@ tag_func_define_button (SwfdecSwfDecoder * s, guint tag) SwfdecGraphic *graphic = swfdec_swf_decoder_get_character (s, gid); if (SWFDEC_IS_GRAPHIC (graphic)) { SwfdecRect r...
2007 May 01
0
2 commits - libswfdec/swfdec_bits.c
...dec_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_get_u8 (bits); grad->array[i].color = swfdec_bits_get_color (bits);
2007 Apr 28
0
libswfdec/swfdec_font.c
...fdec_bits_getbits (&s->b, 4); SWFDEC_LOG ("n_line_bits = %d", shape->n_line_bits); - - swfdec_bits_init_bits (&s->b, &save_bits, size); swfdec_shape_get_recs (s, shape, swfdec_pattern_parse, swfdec_stroke_parse); + swfdec_bits_syncbits (&s->b); if (swfdec_bits_left (&s->b)) { SWFDEC_WARNING ("parsing shape didn't use %d bytes",
2007 Oct 26
0
3 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c
...(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->version); } if (swfdec_bits_left (&bits)) { SWFDEC_WARNING ("leftover bytes in Try action"); } - SWFDEC_FIXME ("Try action not implemented"); + swfdec_as_frame_push_block (cx->frame, data + len, data + len + try_size, + swfdec_action_try_end_try, try_data, NULL); } static void commit...
2007 Jun 06
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_root_sprite.h libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_swf_decoder.h libswfdec/swfdec_tag.c
...a = data; - g_array_append_val (array, action); -} - -int -tag_func_export_assets (SwfdecSwfDecoder * s) -{ - SwfdecBits *bits = &s->b; - guint count, i; - - count = swfdec_bits_get_u16 (bits); - SWFDEC_LOG ("exporting %u assets", count); - for (i = 0; i < count && swfdec_bits_left (bits); i++) { - guint id; - SwfdecCharacter *object; - char *name; - id = swfdec_bits_get_u16 (bits); - object = swfdec_swf_decoder_get_character (s, id); - name = swfdec_bits_get_string (bits); - if (object == NULL) { - SWFDEC_ERROR ("cannot export id %u as %s, id w...
2008 Jan 27
2
[Bug 14264] New: flash ad that kills your machine
...so.5.0.0 swfdec_bits_getbits 5581 1.2335 libswfdec-0.5.so.5.0.0 swfdec_sprite_movie_iterate_end 5264 1.1634 libswfdec-0.5.so.5.0.0 swfdec_movie_set_static_properties 4923 1.0881 libswfdec-0.5.so.5.0.0 swfdec_movie_get_own_resource 4506 0.9959 libswfdec-0.5.so.5.0.0 swfdec_bits_left 4354 0.9623 libswfdec-0.5.so.5.0.0 swfdec_movie_get_type 4304 0.9513 libswfdec-0.5.so.5.0.0 swfdec_ring_buffer_get_n_elements 4150 0.9172 libswfdec-0.5.so.5.0.0 swfdec_movie_iterate_end 4075 0.9006 libswfdec-0.5.so.5.0.0 swfdec_player_remove_all_actions 3924 0.8...