Displaying 20 results from an estimated 97 matches for "swfdecbit".
Did you mean:
swfdecbits
2007 Apr 26
0
4 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h NEWS README
...gnome.org>
Date: Tue Apr 24 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...
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...b->ptr); \
+ g_assert (b->idx == 0); \
+ if ((unsigned long) (b->end - b->ptr) < n) { \
+ SWFDEC_ERROR ("reading past end of buffer"); \
+ b->ptr = b->end; \
+ b->idx = 0; \
+ return 0; \
+ } \
+} G_STMT_END
+
/**
* swfdec_bits_init:
* @bits: a #SwfdecBits
@@ -56,6 +75,32 @@ swfdec_bits_init (SwfdecBits *bits, Swfd
}
/**
+ * swfdec_bits_init_bits:
+ * @bits: a #SwfdecBits
+ * @from: a #SwfdecBits to initialize from
+ * @bytes: number of bytes to move to @bits
+ *
+ * Initializes @bits for use with the next @bytes bytes from @from. If not
+ * eno...
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_frame; /* last decoded frame */
gboolean done; /* TRUE when no new data will be made available */
};
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 46b0581..6e25cf7 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -87,7 +87,7 @@ swfdec_bits_init (SwfdecBits *bits, Swfd
* available using swfdec_bits_left() before calling this function.
**/
void
-swfdec_bits_init_bits (SwfdecBits *bits, SwfdecBits *from, unsigned int bytes)
+swfdec_bits_init_bits (SwfdecBits *bits, SwfdecBits *from, guint bytes)
{
g_return_if_fail (bits != NULL);
g_return_i...
2007 Sep 17
0
2 commits - libswfdec/swfdec_bits.c
...jamin Otte <otte at gnome.org>
Date: Mon Sep 17 11:31:24 2007 +0200
more bad duplication
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index bddef90..2d1551a 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -599,12 +599,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 (mor...
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
.../* version of the script */
++ guint n_registers; /* number of registers */
gpointer debugger; /* debugger owning us or NULL */
/* needed by functions */
SwfdecBuffer * constant_pool; /* constant pool action */
@@@ -73,15 -73,14 +73,15 @@@
SwfdecScript * swfdec_script_new (SwfdecBits * bits,
const char * name,
- unsigned int version);
- guint version);
++ guint version);
SwfdecScript * swfdec_script_new_for_player (SwfdecPlayer * player,
SwfdecBits * bits,
const char * name,
- unsigned int ve...
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
...dit_file_get_version (SwfeditFile * file);
G_END_DECLS
diff --git a/test/swfedit_list.c b/test/swfedit_list.c
index 35ab0a3..289d7de 100644
--- a/test/swfedit_list.c
+++ b/test/swfedit_list.c
@@ -99,7 +99,7 @@ swfedit_list_new (const SwfeditTagDefini
}
SwfeditList *
-swfedit_list_new_read (SwfdecBits *bits, const SwfeditTagDefinition *def)
+swfedit_list_new_read (SwfeditToken *parent, SwfdecBits *bits, const SwfeditTagDefinition *def)
{
SwfeditList *list;
SwfeditTokenEntry *entry;
@@ -109,6 +109,7 @@ swfedit_list_new_read (SwfdecBits *bits,
g_return_val_if_fail (def != NULL, NULL);...
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
...its_get_string (&bits, 7);
if (!s) {
g_string_free (string, TRUE);
return NULL;
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 992ec27..fbc35fc 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -481,18 +481,18 @@ swfdec_bits_skip_string (SwfdecBits *bits)
}
/**
- * swfdec_bits_get_string_with_version:
+ * swfdec_bits_get_string:
* @bits: a #SwfdecBits
* @version: Flash player version
*
* Prior to Flash 6, strings used to be encoded as LATIN1. Since Flash 6,
- * strings are encoded as UTF-8. This version does the check automatica...
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
..._rgba (SwfdecOut * out,
+ SwfdecColor color);
void swfdec_out_put_rect (SwfdecOut * out,
SwfdecRect * rect);
diff --git a/test/swfedit_tag.c b/test/swfedit_tag.c
index 55020a0..dd15978 100644
--- a/test/swfedit_tag.c
+++ b/test/swfedit_tag.c
@@ -96,6 +96,30 @@ swfedit_rect_read (SwfdecBits *bits)
return rect;
}
+static void
+swfedit_rgb_write (gpointer data, SwfdecOut *out)
+{
+ swfdec_out_put_rgb (out, GPOINTER_TO_UINT (data));
+}
+
+static gpointer
+swfedit_rgb_read (SwfdecBits *bits)
+{
+ return GUINT_TO_POINTER (swfdec_bits_get_color (bits));
+}
+
+static void
+swfedit_r...
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
...if (cx->fp->constant_pool)
+ swfdec_constant_pool_free (cx->fp->constant_pool);
+ cx->fp->constant_pool = pool;
+ return JS_TRUE;
+}
+
+static JSBool
+swfdec_action_push (JSContext *cx, guint stackspace, const guint8 *data, guint len)
+{
+ /* FIXME: supply API for this */
+ SwfdecBits bits;
+
+ 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...
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
..._define_font (SwfdecSwfDecoder * s, guint tag)
{
guint i, id, n_glyphs, offset, next_offset;
SwfdecFont *font;
@@ -267,7 +266,7 @@ swfdec_font_parse_kerning_table (SwfdecS
}
int
-tag_func_define_font_2 (SwfdecSwfDecoder * s)
+tag_func_define_font_2 (SwfdecSwfDecoder * s, guint tag)
{
SwfdecBits *bits = &s->b;
guint id;
@@ -380,7 +379,7 @@ tag_func_define_font_2 (SwfdecSwfDecoder
}
int
-tag_func_define_font_3 (SwfdecSwfDecoder * s)
+tag_func_define_font_3 (SwfdecSwfDecoder * s, guint tag)
{
SwfdecBits offsets, *bits = &s->b;
SwfdecFont *font;
diff --git a/libsw...
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
...ome.org>
Date: Tue Apr 17 12:19:27 2007 +0200
avoid overflow issues when bytes is near MAXUINT
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 8eef225..0f7e4c9 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -95,7 +95,9 @@ swfdec_bits_init_bits (SwfdecBits *bits,
bits->buffer = from->buffer;
bits->ptr = from->ptr;
- bits->end = MIN (bits->ptr + bytes, from->end);
+ if (bytes > (guint) (from->end - from->ptr))
+ bytes = from->end - from->ptr;
+ bits->end = bits->ptr + bytes;
bits->idx = 0;...
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
...ome.org>
Date: Tue Apr 17 12:19:27 2007 +0200
avoid overflow issues when bytes is near MAXUINT
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 8eef225..0f7e4c9 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -95,7 +95,9 @@ swfdec_bits_init_bits (SwfdecBits *bits,
bits->buffer = from->buffer;
bits->ptr = from->ptr;
- bits->end = MIN (bits->ptr + bytes, from->end);
+ if (bytes > (guint) (from->end - from->ptr))
+ bytes = from->end - from->ptr;
+ bits->end = bits->ptr + bytes;
bits->idx = 0;...
2007 Feb 15
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_shape.c libswfdec/swfdec_tag.c
...3dfe323eac13d24448146807 (from b9d7f15528e25b22099507ad00bba595e53025af)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Feb 15 09:32:32 2007 +0100
Update some parsing code to the 21st century
DefineSprite and DefineFont tags were still doing old-style manipulation of
the SwfdecBits which could cause crashes. This patch updates it to use the
"new" functions.
diff --git a/libswfdec/swfdec_tag.c b/libswfdec/swfdec_tag.c
index e7c8aa8..f4497f2 100644
--- a/libswfdec/swfdec_tag.c
+++ b/libswfdec/swfdec_tag.c
@@ -190,35 +190,30 @@ tag_func_define_text_2 (SwfdecSwfDe...
2007 Jul 11
0
libswfdec/swfdec_bits.c
...41:01 2007 +0200
don't access memory unaligned (fixes #11492)
Hopefully fixes it...
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index c8a5062..8ec6936 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -307,11 +307,9 @@ swfdec_bits_get_float (SwfdecBits * b)
SWFDEC_BYTES_CHECK (b, 4);
- conv.i = *((gint32 *) b->ptr);
+ conv.i = (b->ptr[3] << 24) | (b->ptr[2] << 16) | (b->ptr[1] << 8) | b->ptr[0];
b->ptr += 4;
- conv.i = GINT32_FROM_LE (conv.i);
-
return conv.f;
}
@@ -323,40 +321,30 @@ swfde...
2007 Jul 11
0
Branch 'as' - 3 commits - libswfdec/swfdec_bits.c
...41:01 2007 +0200
don't access memory unaligned (fixes #11492)
Hopefully fixes it...
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index c8a5062..8ec6936 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -307,11 +307,9 @@ swfdec_bits_get_float (SwfdecBits * b)
SWFDEC_BYTES_CHECK (b, 4);
- conv.i = *((gint32 *) b->ptr);
+ conv.i = (b->ptr[3] << 24) | (b->ptr[2] << 16) | (b->ptr[1] << 8) | b->ptr[0];
b->ptr += 4;
- conv.i = GINT32_FROM_LE (conv.i);
-
return conv.f;
}
@@ -323,40 +321,30 @@ swfde...
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
...quot;charAt")
+ 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;
g...
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
...swfdec_bits.h b/libswfdec/swfdec_bits.h
index 0dd1dd9..d568dd8 100644
--- a/libswfdec/swfdec_bits.h
+++ b/libswfdec/swfdec_bits.h
@@ -26,8 +26,6 @@
#include <libswfdec/swfdec_color.h>
#include <libswfdec/swfdec_buffer.h>
-#define SWFDEC_TEXT_SCALE_FACTOR (1024.0)
-
typedef struct _SwfdecBits SwfdecBits;
struct _SwfdecBits
diff --git a/libswfdec/swfdec_font.c b/libswfdec/swfdec_font.c
index d70a881..ac64c22 100644
--- a/libswfdec/swfdec_font.c
+++ b/libswfdec/swfdec_font.c
@@ -206,6 +206,7 @@ tag_func_define_font (SwfdecSwfDecoder *
font = swfdec_swf_decoder_create_character (s,...
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
...parsing @dec into a new #SwfdecPattern
- *
- * Returns: a new #SwfdecPattern or NULL on error
- **/
-SwfdecPattern *
-swfdec_pattern_parse (SwfdecSwfDecoder *dec, gboolean rgba)
+static SwfdecPattern *
+swfdec_pattern_do_parse (SwfdecSwfDecoder *dec, gboolean rgba)
{
guint paint_style_type;
SwfdecBits *bits;
SwfdecPattern *pattern;
- g_return_val_if_fail (dec != NULL, NULL);
-
bits = &dec->b;
paint_style_type = swfdec_bits_get_u8 (bits);
SWFDEC_LOG (" type 0x%02x", paint_style_type);
@@ -356,6 +345,31 @@ swfdec_pattern_parse (SwfdecSwfDecoder *
}
/**
+ * s...
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
..._CLASS (swfedit_file_parent_class)->dispose (object);
+}
+
+static void *
+zalloc (void *opaque, unsigned int items, unsigned int size)
+{
+ return g_malloc (items * size);
+}
+
+static void
+zfree (void *opaque, void *addr)
+{
+ g_free (addr);
+}
+
+static SwfdecBuffer *
+swfenc_file_inflate (SwfdecBits *bits, guint size)
+{
+ SwfdecBuffer *decoded, *encoded;
+ z_stream z;
+ int ret;
+
+ encoded = swfdec_bits_get_buffer (bits, -1);
+ if (encoded == NULL)
+ return NULL;
+ decoded = swfdec_buffer_new_and_alloc (size);
+ z.zalloc = zalloc;
+ z.zfree = zfree;
+ z.opaque = NULL;
+ z.next_...
2007 Oct 31
0
5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_audio.c libswfdec/swfdec_sound.c libswfdec/swfdec_xml.c
...Previous way of reading sound envelopes was still somewhat off, fixed
diff --git a/libswfdec/swfdec_sound.c b/libswfdec/swfdec_sound.c
index 0e7f831..3e9da94 100644
--- a/libswfdec/swfdec_sound.c
+++ b/libswfdec/swfdec_sound.c
@@ -303,8 +303,7 @@ swfdec_sound_parse_chunk (SwfdecSwfDecoder *s, SwfdecBits *b, int id)
int has_loops;
int has_out_point;
int has_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->...