Displaying 10 results from an estimated 10 matches for "swfdec_bits_get_float".
2007 Jul 11
0
libswfdec/swfdec_bits.c
...Date: Wed Jul 11 16: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,...
2007 Jul 11
0
Branch 'as' - 3 commits - libswfdec/swfdec_bits.c
...Date: Wed Jul 11 16: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,...
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
...&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 = swfdec_bits_get_float (&bits);
+ if (!JS_NewDoubleValue (cx, d, cx->fp->sp))
+ return JS_FALSE;
+ cx->fp->sp++;
+ break;
+ }
+ case 2: /* null */
+ *cx->fp->sp++ = JSVAL_NULL;
+ break;
+ case 3: /* undefined */
+ *cx->fp->sp++ = JSVAL_VOID;
+ break;
+ case 5: /* boole...
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
...its_skip_string (&bits);
- if (!swfdec_action_push_string (cx, s))
- return JS_FALSE;
+ if (s == NULL)
+ return;
+ SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (stack),
+ swfdec_as_context_get_string (cx, s));
break;
}
case 1: /* float */
- {
- double d = swfdec_bits_get_float (&bits);
- if (!JS_NewDoubleValue (cx, d, cx->fp->sp))
- return JS_FALSE;
- cx->fp->sp++;
- break;
- }
+ SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_push (stack),
+ swfdec_bits_get_float (&bits));
+ break;
case 2: /* null */
- *cx->fp->sp++ = JSVAL_NU...
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...+ if (!s) {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+ g_string_append_c (string, '"');
+ g_string_append (string, s);
+ g_string_append_c (string, '"');
+ break;
+ }
+ case 1: /* float */
+ g_string_append_printf (string, "%g", swfdec_bits_get_float (&bits));
+ break;
+ case 2: /* null */
+ g_string_append (string, "null");
+ break;
+ case 3: /* undefined */
+ g_string_append (string, "undefined");
+ break;
+ case 4: /* register */
+ g_string_append_printf (string, "Register %u", swfdec_bits_get...
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
...&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 = swfdec_bits_get_float (&bits);
+ if (!JS_NewDoubleValue (cx, d, cx->fp->sp))
+ return JS_FALSE;
+ cx->fp->sp++;
+ break;
+ }
+ case 2: /* null */
+ *cx->fp->sp++ = JSVAL_NULL;
+ break;
+ case 3: /* undefined */
+ *cx->fp->sp++ = JSVAL_VOID;
+ break;
+ case 4: /* regis...
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
...its *b);
-unsigned int swfdec_bits_get_bu24 (SwfdecBits *b);
-unsigned int swfdec_bits_get_bu32 (SwfdecBits *b);
+guint swfdec_bits_get_u32 (SwfdecBits * b);
+guint swfdec_bits_get_bu16 (SwfdecBits *b);
+guint swfdec_bits_get_bu24 (SwfdecBits *b);
+guint swfdec_bits_get_bu32 (SwfdecBits *b);
float swfdec_bits_get_float (SwfdecBits * b);
double swfdec_bits_get_double (SwfdecBits * b);
double swfdec_bits_get_bdouble (SwfdecBits * b);
@@ -64,7 +64,7 @@ void swfdec_bits_get_matrix (SwfdecBits
const char *swfdec_bits_skip_string (SwfdecBits * bits);
guint swfdec_bits_skip_bytes (SwfdecBits *bits, guint bytes);
c...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...*/
- s = swfdec_bits_skip_string (state->bits);
- if (s == NULL) {
- compile_state_error (state, "Push: Could not get string");
- return;
- }
- compile_state_debug_add (state, "Push \"%s\"", s);
- push_string (state, s);
- break;
- case 1: /* float */
- d = swfdec_bits_get_float (state->bits);
- compile_state_debug_add (state, "Push %g", d);
- push_double (state, d);
- break;
- case 2: /* null */
- compile_state_debug_add (state, "Push null");
- ONELINER (state, JSOP_NULL);
- break;
- case 3: /* undefined */
- compile_state_debug_add (state...
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
...its *b);
-unsigned int swfdec_bits_get_bu24 (SwfdecBits *b);
-unsigned int swfdec_bits_get_bu32 (SwfdecBits *b);
+guint swfdec_bits_get_u32 (SwfdecBits * b);
+guint swfdec_bits_get_bu16 (SwfdecBits *b);
+guint swfdec_bits_get_bu24 (SwfdecBits *b);
+guint swfdec_bits_get_bu32 (SwfdecBits *b);
float swfdec_bits_get_float (SwfdecBits * b);
double swfdec_bits_get_double (SwfdecBits * b);
double swfdec_bits_get_bdouble (SwfdecBits * b);
@@ -64,7 +64,7 @@ void swfdec_bits_get_matrix (SwfdecBits
const char *swfdec_bits_skip_string (SwfdecBits * bits);
guint swfdec_bits_skip_bytes (SwfdecBits *bits, guint bytes);
c...
2007 Jan 25
0
Branch 'interpreter' - 28 commits - configure.ac libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_player.c
...double, not a float
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 583c2f1..0256d8c 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -251,7 +251,7 @@ swfdec_action_push (JSContext *cx, guint
break;
case 6: /* double */
{
- double d = swfdec_bits_get_float (&bits);
+ double d = swfdec_bits_get_double (&bits);
if (!JS_NewDoubleValue (cx, d, cx->fp->sp))
return JS_FALSE;
cx->fp->sp++;
diff-tree f07034751126d85a58b48ff77bbf57c5dc8021ca (from 34c98c5cf9deb0b5fc10f0cbee7bf368f3653000)
Author: Benjamin Otte <otte@gnom...