Displaying 20 results from an estimated 21 matches for "swfdec_bits_skip_bytes".
2007 Aug 13
0
2 commits - libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h
...= swfdec_bits_get_u8 (bits);
- SWFDEC_LOG (" filters: %u", n_filters);
- for (i = 0; i < n_filters && swfdec_bits_left (bits); i++) {
- filter_id = swfdec_bits_get_u8 (bits);
- switch (filter_id) {
- case 0:
- SWFDEC_WARNING (" drop shadow");
- swfdec_bits_skip_bytes (bits, 16);
- break;
- case 1:
- SWFDEC_WARNING (" blur");
- swfdec_bits_skip_bytes (bits, 9);
- break;
- case 2:
- SWFDEC_WARNING (" glow");
- swfdec_bits_skip_bytes (bits, 15);
- break;
- case 3:
- SWFDEC_WARNING (" bevel");
- swfdec_bits_s...
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
...= swfdec_bits_get_u8 (bits);
- SWFDEC_LOG (" filters: %u", n_filters);
- for (i = 0; i < n_filters && swfdec_bits_left (bits); i++) {
- filter_id = swfdec_bits_get_u8 (bits);
- switch (filter_id) {
- case 0:
- SWFDEC_WARNING (" drop shadow");
- swfdec_bits_skip_bytes (bits, 16);
- break;
- case 1:
- SWFDEC_WARNING (" blur");
- swfdec_bits_skip_bytes (bits, 9);
- break;
- case 2:
- SWFDEC_WARNING (" glow");
- swfdec_bits_skip_bytes (bits, 15);
- break;
- case 3:
- SWFDEC_WARNING (" bevel");
- swfdec_bits_s...
2007 Feb 15
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_shape.c libswfdec/swfdec_tag.c
...r > endptr) {
- SWFDEC_WARNING ("parse overrun (%d bytes)", s->b.ptr - endptr);
- }
+ if (swfdec_bits_left (&s->b)) {
+ SWFDEC_WARNING ("early parse finish (%d bytes)",
+ swfdec_bits_left (&s->b) / 8);
}
}
- if (swfdec_bits_skip_bytes (&parse, tag_len) != tag_len)
- break;
-
if (buffer)
swfdec_buffer_unref (buffer);
- if (tag == 0)
- break;
- }
+ } while (tag != 0);
- s->b = save_bits;
- s->b.ptr += s->b.buffer->length;
- /* this assumes that no recursive DefineSprite happens and...
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
...&s->b);
+ font->name = swfdec_bits_get_string_length (&s->b, len);
+ SWFDEC_LOG (" name = %s", font->name);
+ n_glyphs = swfdec_bits_get_u16 (&s->b);
+ SWFDEC_LOG (" n_glyphs = %u", n_glyphs);
+
+ offsets = *bits;
+ if (wide_offsets) {
+ if (swfdec_bits_skip_bytes (bits, n_glyphs * 4 + 4) != n_glyphs * 4 + 4) {
+ SWFDEC_ERROR ("DefineFont3 too short");
+ return SWFDEC_STATUS_OK;
+ }
+ offset = swfdec_bits_get_u32 (&offsets);
+ } else {
+ if (swfdec_bits_skip_bytes (bits, n_glyphs * 2 + 2) != n_glyphs * 2 + 2) {
+ SWFDEC...
2007 Apr 22
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_movie.c
...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 bytes too much\n",
- (swfdec_bits_left (&a...
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
...82..a81b389 100644
--- a/libswfdec/swfdec_shape.c
+++ b/libswfdec/swfdec_shape.c
@@ -1038,7 +1038,10 @@ tag_define_morph_shape (SwfdecSwfDecoder
swfdec_bits_get_rect (bits, &morph->end_extents);
offset = swfdec_bits_get_u32 (bits);
end_bits = *bits;
- end_bits.ptr += offset;
+ if (swfdec_bits_skip_bytes (&end_bits, offset) != offset) {
+ SWFDEC_ERROR ("wrong offset in DefineMorphShape");
+ return SWFDEC_STATUS_OK;
+ }
bits->end = end_bits.ptr;
swfdec_shape_add_styles (s, SWFDEC_SHAPE (morph),
diff-tree d7461508e0d76b7eaa89cc67427f8415884d29f7 (from 42e6df0df9df1b028...
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
...82..a81b389 100644
--- a/libswfdec/swfdec_shape.c
+++ b/libswfdec/swfdec_shape.c
@@ -1038,7 +1038,10 @@ tag_define_morph_shape (SwfdecSwfDecoder
swfdec_bits_get_rect (bits, &morph->end_extents);
offset = swfdec_bits_get_u32 (bits);
end_bits = *bits;
- end_bits.ptr += offset;
+ if (swfdec_bits_skip_bytes (&end_bits, offset) != offset) {
+ SWFDEC_ERROR ("wrong offset in DefineMorphShape");
+ return SWFDEC_STATUS_OK;
+ }
bits->end = end_bits.ptr;
swfdec_shape_add_styles (s, SWFDEC_SHAPE (morph),
diff-tree d7461508e0d76b7eaa89cc67427f8415884d29f7 (from 42e6df0df9df1b028...
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
...{
const char *s;
@@ -516,13 +516,6 @@ swfdec_bits_get_string_with_version (SwfdecBits *bits, guint version)
}
}
-/* FIXME: deprecated - someone remove this */
-char *
-swfdec_bits_get_string (SwfdecBits * bits)
-{
- return swfdec_bits_get_string_with_version (bits, 6);
-}
-
/**
* swfdec_bits_skip_bytes:
* @bits: a #SwfdecBits
diff --git a/libswfdec/swfdec_bits.h b/libswfdec/swfdec_bits.h
index defa165..29e9cce 100644
--- a/libswfdec/swfdec_bits.h
+++ b/libswfdec/swfdec_bits.h
@@ -62,9 +62,8 @@ void swfdec_bits_get_color_transform (SwfdecBits * bits,
void swfdec_bits_get_matrix (SwfdecBits * bi...
2007 Feb 02
0
Branch 'interpreter' - 6 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_compiler.c libswfdec/swfdec_sprite.c test/swfdec-extract.c
...place_object_2 (SwfdecS
else
script_name = g_strdup_printf ("Sprite%u", SWFDEC_CHARACTER (content->graphic)->id);
while ((event_flags = swfdec_get_clipeventflags (s, bits)) != 0) {
- guint tmp = swfdec_bits_get_u32 (bits);
- SwfdecBits save = *bits;
- swfdec_bits_skip_bytes (&save, tmp);
-
+ guint length = swfdec_bits_get_u32 (bits);
+ SwfdecBits action_bits;
+ SwfdecBuffer *buffer = swfdec_bits_get_buffer (bits, length);
+
+ if (buffer == NULL)
+ break;
+ swfdec_bits_init (&action_bits, buffer);
if (event_flags & SWFDEC_EVE...
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...);
@@ -440,6 +436,7 @@ swfdec_bits_get_matrix (SwfdecBits * bit
matrix->y0 = swfdec_bits_getsbits (bits, n_translate_bits);
swfdec_matrix_ensure_invertible (matrix, inverse);
+ swfdec_bits_syncbits (bits);
}
char *
@@ -488,7 +485,7 @@ swfdec_bits_skip_string (SwfdecBits *bit
guint
swfdec_bits_skip_bytes (SwfdecBits *bits, guint n_bytes)
{
- swfdec_bits_syncbits (bits);
+ g_assert (bits->idx == 0);
if ((guint) (bits->end - bits->ptr) < n_bytes) {
SWFDEC_WARNING ("supposed to skip %u bytes, but only %td available",
n_bytes, bits->end - bits->ptr);
@@ -597,13...
2007 Nov 10
1
3 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h
...+ b/libswfdec/swfdec_image.c
@@ -558,10 +558,28 @@ swfdec_image_colormap_decode (SwfdecImage * image,
}
}
+static cairo_status_t
+swfdec_image_png_read (void *bitsp, unsigned char *data, unsigned int length)
+{
+ SwfdecBits *bits = bitsp;
+ const guint8 *ptr;
+
+ ptr = bits->ptr;
+ if (swfdec_bits_skip_bytes (bits, length) != length)
+ return CAIRO_STATUS_READ_ERROR;
+
+ memcpy (data, ptr, length);
+ return CAIRO_STATUS_SUCCESS;
+}
+
static void
swfdec_image_png_load (SwfdecImage *image)
{
- SWFDEC_ERROR ("implement loading PNG images");
+ SwfdecBits bits;
+
+ swfdec_bits_init (&am...
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
...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);
SWFDEC_LOG ("n_line_bits = %d", shape-&...
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
..., g, b, a;
r = swfdec_bits_get_u8 (bits);
g = swfdec_bits_get_u8 (bits);
diff --git a/libswfdec/swfdec_bits.h b/libswfdec/swfdec_bits.h
index 08ae1d8..a44c9e2 100644
--- a/libswfdec/swfdec_bits.h
+++ b/libswfdec/swfdec_bits.h
@@ -65,8 +65,8 @@ const char *swfdec_bits_skip_string (Swf
guint swfdec_bits_skip_bytes (SwfdecBits *bits, guint bytes);
char *swfdec_bits_get_string (SwfdecBits * bits);
char *swfdec_bits_get_string_length (SwfdecBits * bits, unsigned int len);
-unsigned int swfdec_bits_get_color (SwfdecBits * bits);
-unsigned int swfdec_bits_get_rgba (SwfdecBits * bits);
+SwfdecColor swfdec_bits_g...
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_ERROR ("parsed string is not valid utf-8");
+ return NULL;
+ }
+ return g_strdup (s);
+ }
+}
+
+/* FIXME: deprecated - someone remove this */
+char *
+swfdec_bits_get_string (SwfdecBits * bits)
+{
+ return swfdec_bits_get_string_with_version (bits, 6);
+}
+
+/**
* swfdec_bits_skip_bytes:
* @bits: a #SwfdecBits
* @n_bytes: number of bytes to skip
diff --git a/libswfdec/swfdec_bits.h b/libswfdec/swfdec_bits.h
index a86e705..8d6492e 100644
--- a/libswfdec/swfdec_bits.h
+++ b/libswfdec/swfdec_bits.h
@@ -61,10 +61,10 @@ void swfdec_bits_get_color_transform (Sw
SwfdecColorTrans...
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
...t 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;
@@ -541,7 +541,7 @@ swfdec_bits_get_string_length (SwfdecBit
SwfdecColor
swfdec_bits_get_color (SwfdecBits * 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
...40,7 +140,7 @@ swfdec_codec_screen_decode (gpointer cod
if (inflateReset(&screen->z) != Z_OK) {
SWFDEC_ERROR ("error resetting zlib decoder: %s", screen->z.msg);
}
- screen->z.next_in = bits.ptr;
+ screen->z.next_in = (void *) bits.ptr;
if (swfdec_bits_skip_bytes (&bits, size) != size) {
SWFDEC_ERROR ("not enough bytes available");
return NULL;
diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c
index 6c2dcae..c9df0de 100644
--- a/libswfdec/swfdec_image.c
+++ b/libswfdec/swfdec_image.c
@@ -99,46 +99,30 @@ zfree (void *opaque,...
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
...t 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;
@@ -541,7 +541,7 @@ swfdec_bits_get_string_length (SwfdecBit
SwfdecColor
swfdec_bits_get_color (SwfdecBits * bits)...
2007 Jul 18
0
12 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_playback_alsa.c libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c
...s: %u", n_filters);
for (i = 0; i < n_filters && swfdec_bits_left (bits); i++) {
- id = swfdec_bits_get_u8 (bits);
- switch (id) {
+ filter_id = swfdec_bits_get_u8 (bits);
+ switch (filter_id) {
case 0:
SWFDEC_WARNING (" drop shadow");
swfdec_bits_skip_bytes (bits, 16);
@@ -237,7 +237,7 @@ swfdec_sprite_movie_perform_place (Swfde
}
break;
default:
- SWFDEC_ERROR ("unknown filter id %u", id);
+ SWFDEC_ERROR ("unknown filter id %u", filter_id);
break;
}
}
diff --git a/libswfdec/swfdec_sprite_movie_as.c b/...
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
...ock_buffer */
size = swfdec_bits_get_bu16 (&bits);
if (size == 0)
continue;
- if (inflateReset(&screen->z) != Z_OK) {
- SWFDEC_ERROR ("error resetting zlib decoder: %s", screen->z.msg);
- }
- screen->z.next_in = (void *) bits.ptr;
- if (swfdec_bits_skip_bytes (&bits, size) != size) {
- SWFDEC_ERROR ("not enough bytes available");
- return NULL;
- }
- screen->z.avail_in = size;
- screen->z.next_out = screen->block_buffer->data;
- screen->z.avail_out = screen->block_buffer->length;
- result = inf...
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
...e, has_filters;
/* we parse the placement info into buffers each containing one palcement */
@@ -163,7 +163,8 @@ tag_func_define_button_2 (SwfdecSwfDecoder * s, guint tag)
SWFDEC_LOG (" reserved = %d", reserved);
}
states = swfdec_bits_getbits (&bits, 4);
- swfdec_bits_skip_bytes (&bits, 4);
+ swfdec_bits_get_u16 (&bits);
+ gid = swfdec_bits_get_u16 (&bits);
SWFDEC_LOG (" states: %s%s%s%s",
states & (1 << SWFDEC_BUTTON_HIT) ? "HIT " : "",
@@ -171,7 +172,7 @@ tag_func_define_button_2 (SwfdecSwfDecode...