Displaying 20 results from an estimated 29 matches for "swfdec_bits_syncbits".
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...g != 0);
diff-tree 49e51702c80e2304918b74b897638948a507b4bd (from 20fce106dfb4e4f314fa9ed2eb639448a0b5d854)
Author: Benjamin Otte <otte@gnome.org>
Date: Fri Mar 23 14:03:09 2007 +0100
change semantics of SwfdecBits.idx handling
previously functions reading whole bytes called swfdec_bits_syncbits before
doing any reading. Now everyone using SwfdecBits for reading bits is
responsible for syncing when they want to resume reading bytes. The byte
reading code asserts that bits->idx == 0.
This change may introduce segfaults with code that isn't yet canged to call...
2007 Apr 22
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_movie.c
...(SwfdecSwfDecode
shape->n_line_bits = swfdec_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_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 b...
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
...;n_fill_bits = swfdec_bits_getbits (&s->b, 4);
+ SWFDEC_LOG ("n_fill_bits = %d", shape->n_fill_bits);
+ shape->n_line_bits = swfdec_bits_getbits (&s->b, 4);
+ SWFDEC_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 b...
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
...#39;s job to syncbits
diff --git a/libswfdec/swfdec_shape.c b/libswfdec/swfdec_shape.c
index a81b389..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);...
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
...#39;s job to syncbits
diff --git a/libswfdec/swfdec_shape.c b/libswfdec/swfdec_shape.c
index a81b389..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);...
2007 Jun 13
0
Branch 'as' - libswfdec/swfdec_swf_decoder.c
...dec/swfdec_swf_decoder.c b/libswfdec/swfdec_swf_decoder.c
index 66c6e34..33fb719 100644
--- a/libswfdec/swfdec_swf_decoder.c
+++ b/libswfdec/swfdec_swf_decoder.c
@@ -239,6 +239,10 @@ swf_parse_header2 (SwfdecSwfDecoder * s)
dec->height = MAX (0, ceil (rect.y1 / SWFDEC_TWIPS_SCALE_FACTOR));
swfdec_bits_syncbits (&s->b);
dec->rate = swfdec_bits_get_u16 (&s->b);
+ if (dec->rate == 0) {
+ SWFDEC_INFO ("rate is 0, setting to 1");
+ dec->rate = 1;
+ }
SWFDEC_LOG ("rate = %g", dec->rate / 256.0);
dec->frames_total = swfdec_bits_get_u16 (&s-&g...
2007 Apr 28
0
libswfdec/swfdec_font.c
...;n_fill_bits);
shape->n_line_bits = swfdec_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 Jan 22
0
Branch 'interpreter' - 3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_swf_decoder.c test/Makefile.am test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_tag.c test/swfedit_tag.h test/swfedit_token.c test/swfedit_token.h
...er (bits, -1);
+ if (ret == NULL)
+ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
+ "File too small");
+ return ret;
+ }
+}
+
+static void
+swf_parse_header2 (SwfeditFile *file, SwfdecBits *bits)
+{
+ SwfdecRect rect;
+
+ swfdec_bits_get_rect (bits, &rect);
+ swfdec_bits_syncbits (bits);
+ swfedit_token_add (SWFEDIT_TOKEN (file), "rate", SWFEDIT_TOKEN_UINT16,
+ GUINT_TO_POINTER (swfdec_bits_get_u16 (bits)));
+ swfedit_token_add (SWFEDIT_TOKEN (file), "frames", SWFEDIT_TOKEN_UINT16,
+ GUINT_TO_POINTER (swfdec_bits_get_u16 (bits)));
+}
+
+sta...
2007 Feb 15
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_shape.c libswfdec/swfdec_tag.c
...ag);
@@ -257,32 +244,20 @@ tag_func_define_sprite (SwfdecSwfDecoder
SWFDEC_ERROR ("invalid tag %d %s during DefineSprite",
tag, swfdec_swf_decoder_get_tag_name (tag));
} else {
- const unsigned char *endptr = parse.ptr + tag_len;
ret = func (s);
- swfdec_bits_syncbits (bits);
- if (tag_len > 0) {
- if (s->b.ptr < endptr) {
- SWFDEC_WARNING ("early parse finish (%d bytes)", endptr - s->b.ptr);
- }
- if (s->b.ptr > endptr) {
- SWFDEC_WARNING ("parse overrun (%d bytes)", s->b.ptr -...
2007 Jun 14
0
Branch 'as' - 4 commits - libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie.c player/swfdec_debug_movies.c
...8,7 @@ swfdec_spriteseg_do_place_object (Swfdec
content->color_transform.ga, content->color_transform.gb,
content->color_transform.ba, content->color_transform.bb,
content->color_transform.aa, content->color_transform.ab);
+ content->has_color_transform = TRUE;
}
swfdec_bits_syncbits (bits);
if (has_ratio) {
diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index 3996095..14a307c 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -86,8 +86,9 @@ swfdec_sprite_movie_perform_one_action (
child = swfdec_movie...
2007 Aug 13
0
2 commits - libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h
...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_bits_getbits (bits, 4);
- character = swfdec_bits_get_u16 (bits);
- depth = swfdec_bits_get_u16 (bits);
+ if (s->version >= 8) {
+ reserved = swfdec_bits_getbits (&bits, 2);
+ blend_mode = swfde...
2007 Mar 20
0
9 commits - configure.ac libswfdec/swfdec_bits.c libswfdec/swfdec_debug.c libswfdec/swfdec_js.c libswfdec/swfdec_script.c libswfdec/swfdec_sound.c
...diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 860d2c4..7327413 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -96,8 +96,16 @@ swfdec_bits_left (SwfdecBits *b)
} \
}G_STMT_END
#define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \
+ gulong __bytes; \
swfdec_bits_syncbits (b); \
- SWFDEC_BITS_CHECK (b, 8 * n); \
+ __bytes = b->end - b->ptr; \
+ if (!(__bytes > n || \
+ (__bytes == n && b->idx == 0))) { \
+ SWFDEC_ERROR ("reading past end of buffer"); \
+ b->ptr = b->end; \
+ b->idx = 0; \
+ return 0; \
+...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...e (gpointer data, SwfdecOut *out, gconstpointer hint)
{
swfdec_out_put_rect (out, data);
}
static gpointer
-swfedit_rect_read (SwfdecBits *bits)
+swfedit_rect_read (SwfdecBits *bits, gconstpointer hint)
{
SwfdecRect *rect = g_new (SwfdecRect, 1);
swfdec_bits_get_rect (bits, rect);
+ swfdec_bits_syncbits (bits);
return rect;
}
static void
-swfedit_rgb_write (gpointer data, SwfdecOut *out)
+swfedit_string_write (gpointer data, SwfdecOut *out, gconstpointer hint)
+{
+ swfdec_out_put_string (out, data);
+}
+
+static gpointer
+swfedit_string_read (SwfdecBits *bits, gconstpointer hint)
+{
+ cha...
2007 Apr 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_font.c libswfdec/swfdec_loadertarget.c libswfdec/swfdec_movie.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player.c
...t.x0, rect.y0);
+ SWFDEC_INFO ("SWF size: %g x %g pixels", rect.x1 / SWFDEC_TWIPS_SCALE_FACTOR,
+ rect.y1 / SWFDEC_TWIPS_SCALE_FACTOR);
+ dec->width = MAX (0, ceil (rect.x1 / SWFDEC_TWIPS_SCALE_FACTOR));
+ dec->height = MAX (0, ceil (rect.y1 / SWFDEC_TWIPS_SCALE_FACTOR));
swfdec_bits_syncbits (&s->b);
dec->rate = swfdec_bits_get_u16 (&s->b);
SWFDEC_LOG ("rate = %g", dec->rate / 256.0);
diff-tree 61c1915ce1a6b610a5023443af62d64632322b6a (from ffd9d1fab29d4f256c59b597aac0a11ee1f58317)
Author: Benjamin Otte <otte@gnome.org>
Date: Fri Apr 13 14:50...
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
...(SwfdecBits *b)
return r;
}
-unsigned int
+guint
swfdec_bits_get_bu32 (SwfdecBits *b)
{
- unsigned int r;
+ guint r;
SWFDEC_BYTES_CHECK (b, 4);
@@ -478,7 +478,7 @@ swfdec_bits_skip_string (SwfdecBits *bit
{
char *s;
const char *end;
- unsigned int len;
+ guint len;
swfdec_bits_syncbits (bits);
end = memchr (bits->ptr, 0, bits->end - bits->ptr);
@@ -522,7 +522,7 @@ swfdec_bits_skip_bytes (SwfdecBits *bits
}
char *
-swfdec_bits_get_string_length (SwfdecBits * bits, unsigned int len)
+swfdec_bits_get_string_length (SwfdecBits * bits, guint len)
{
char *ret;
@@...
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
...= { "GotoFrame2", swfdec_action_print_goto_frame2, 1, 0, { NULL, swfdec_action_goto_frame2, swfdec_action_goto_frame2, swfdec_action_goto_frame2, swfdec_action_goto_frame2 } }
+#endif
};
char *
@@ -2735,7 +2700,6 @@ swfdec_script_new (SwfdecBits *bits, con
return NULL;
}
- swfdec_bits_syncbits (bits);
start = bits->ptr;
script = g_new0 (SwfdecScript, 1);
script->refcount = 1;
@@ -2792,21 +2756,7 @@ swfdec_script_unref (SwfdecScript *scrip
g_free (script);
}
-#ifndef MAX_INTERP_LEVEL
-#if defined(XP_OS2)
-#define MAX_INTERP_LEVEL 250
-#elif defined _MSC_VER &&...
2007 Apr 16
0
7 commits - libswfdec/swfdec_codec_gst.c libswfdec/swfdec_font.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_sprite.c
...@ swfdec_font_parse_shape (SwfdecSwfDecode
shape->n_line_bits = swfdec_bits_getbits (&s->b, 4);
SWFDEC_LOG ("n_line_bits = %d", shape->n_line_bits);
- swfdec_shape_get_recs (s, shape);
+ 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");
@@ -336,7 +336,7 @@ tag_func_define_font_2 (SwfdecSwfDecoder
shape->n_line_bits = swfdec_bits_getbits (&s->b, 4);
SWF...
2007 Nov 02
0
5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_date.c libswfdec/swfdec_as_date.h libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_filter.c
...v 2 16:27:19 2007 +0200
Rate 0 means 65536 not 1
diff --git a/libswfdec/swfdec_swf_decoder.c b/libswfdec/swfdec_swf_decoder.c
index 1e4e247..7269b68 100644
--- a/libswfdec/swfdec_swf_decoder.c
+++ b/libswfdec/swfdec_swf_decoder.c
@@ -230,8 +230,8 @@ swf_parse_header2 (SwfdecSwfDecoder * s)
swfdec_bits_syncbits (&s->b);
dec->rate = swfdec_bits_get_u16 (&s->b);
if (dec->rate == 0) {
- SWFDEC_INFO ("rate is 0, setting to 1");
- dec->rate = 1;
+ SWFDEC_INFO ("rate is 0, setting to 65536");
+ dec->rate = 65536;
}
SWFDEC_LOG ("rate = %g...
2007 Jun 15
0
Branch 'as' - 5 commits - libswfdec/swfdec_as_native_function.c libswfdec/swfdec_edittext.c libswfdec/swfdec_edittext.h libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_morphshape.h
...swfdec_swf_decoder_parse (SwfdecDecoder
tag, swfdec_swf_decoder_get_tag_name (tag));
} else if (s->main_sprite->parse_frame < s->main_sprite->n_frames) {
s->parse_sprite = s->main_sprite;
- ret = func (s);
+ ret = func (s, tag);
s->parse_sprite = NULL;
swfdec_bits_syncbits (&s->b);
diff --git a/libswfdec/swfdec_swf_decoder.h b/libswfdec/swfdec_swf_decoder.h
index a913447..930d1e3 100644
--- a/libswfdec/swfdec_swf_decoder.h
+++ b/libswfdec/swfdec_swf_decoder.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
//typedef struct _SwfdecSwfDecoder SwfdecSwfDecoder;
typedef struc...
2007 Jun 06
0
Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...SWFDEC_AS_CONSTANT_STRING ("charCodeAt")
/* add more here */
;
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index c8a5062..9fb0041 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -470,22 +470,14 @@ swfdec_bits_get_matrix (SwfdecBits * bit
swfdec_bits_syncbits (bits);
}
-char *
-swfdec_bits_get_string (SwfdecBits * bits)
-{
- const char *s = swfdec_bits_skip_string (bits);
-
- return g_strdup (s);
-}
-
-const char *
+static const char *
swfdec_bits_skip_string (SwfdecBits *bits)
{
char *s;
const char *end;
guint len;
- swfdec_bits_sync...