search for: endpc

Displaying 20 results from an estimated 25 matches for "endpc".

Did you mean: endp
2007 Feb 01
0
Branch 'interpreter' - libswfdec/swfdec_script.c
...oto (movie, frame); movie->stopped = !play; @@ -315,6 +324,63 @@ swfdec_action_goto_frame2 (JSContext *cx return JS_TRUE; } +static void +swfdec_script_skip_actions (JSContext *cx, guint jump) +{ + SwfdecScript *script = cx->fp->swf; + guint8 *pc = cx->fp->pc; + guint8 *endpc = script->buffer->data + script->buffer->length; + + /* jump instructions */ + g_assert (script); + do { + if (pc >= endpc) + break; + if (*pc & 0x80) { + if (pc + 2 >= endpc) + break; + pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1))); + } else {...
2007 Jan 18
0
Branch 'interpreter' - 2 commits - libswfdec/js libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...OT_MOVIE (movie->root)->decoder; + loaded = dec->frames_loaded; + g_assert (loaded <= movie->n_frames); + } else { + loaded = movie->n_frames; + } + if (loaded < frame) { + SwfdecScript *script = cx->fp->swf; + guint8 *pc = cx->fp->pc; + guint8 *endpc = script->buffer->data + script->buffer->length; + + /* jump instructions */ + g_assert (script); + do { + if (pc >= endpc) + break; + if (*pc & 0x80) { + if (pc + 2 >= endpc) + break; + pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1))); + } else {...
2007 Jan 31
0
Branch 'interpreter' - 3 commits - libswfdec/js libswfdec/swfdec_script.c
...ft, swfdec_action_shift, swfdec_action_shift } }, [0x65] = { "BitURShift", NULL, 2, 1, { NULL, NULL, swfdec_action_shift, swfdec_action_shift, swfdec_action_shift } }, @@ -1994,8 +2071,11 @@ swfdec_script_interpret (SwfdecScript *s while (TRUE) { /* check pc */ - if (pc == endpc) /* needed for scripts created via DefineFunction */ + if (pc == endpc) { + /* scripts created via DefineFunction or the Return action use this way out */ + *rval = fp->rval; break; + } if (pc < startpc || pc >= endpc) { SWFDEC_ERROR ("pc %p not in v...
2007 Sep 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_scope.c libswfdec/swfdec_as_scope.h libswfdec/swfdec_as_script_function.c
...S_VALUE_SET_OBJECT (thisp, obj); } else { SWFDEC_AS_VALUE_SET_NULL (thisp); diff-tree 7abe5c03e87fbfd281426b1cf06e2d4890698338 (from c4ba717de9a7bcabb49dcf5efd94c0dfd4a1fea5) Author: Benjamin Otte <otte at gnome.org> Date: Thu Sep 13 15:49:54 2007 +0200 properly exit when pc == endpc diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index e332c5b..035e1fd 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -797,6 +797,10 @@ start: goto start; } if (pc < startpc || pc >= endpc) { + if (pc == endpc) {...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt 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_stack.c
...07 +0200 implement swfdec_context_as_return diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index 0de1748..cbbc378 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -325,10 +325,14 @@ start: startpc = script->buffer->data; endpc = startpc + script->buffer->length; - while (pc != endpc) { + while (TRUE) { + if (pc == endpc) { + swfdec_as_context_return (context, NULL); + goto start; + } if (pc < startpc || pc >= endpc) { SWFDEC_ERROR ("pc %p not in valid range [%p, %p) anymor...
2007 Mar 28
0
Branch 'as' - 3 commits - 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_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...PTVERSION + 1]; + /* array is for version 3, 4, 5, 6, 7+ */ +} SwfdecActionSpec; + +extern const SwfdecActionSpec actions[256]; +void +swfdec_as_context_run (SwfdecAsContext *context) +{ + SwfdecAsFrame *frame; + SwfdecScript *script; + const SwfdecActionSpec *spec; + guint8 *startpc, *pc, *endpc, *nextpc; + guint action, len; + guint8 *data; + int version; + + g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context)); + + /* setup data */ + frame = context->frame; + if (frame == NULL) + return; + script = frame->script; + version = EXTRACT_VERSION (script->version); + startpc...
2008 Jun 02
4
[Bug 16206] New: Charts in Yahoo Finance crash swfdec
http://bugs.freedesktop.org/show_bug.cgi?id=16206 Summary: Charts in Yahoo Finance crash swfdec Product: swfdec Version: git Platform: Other URL: http://finance.yahoo.com/echarts?s=%5EDJI#symbol=%5EDJI; range=1d OS/Version: All Status: NEW Severity: critical Priority: medium
2007 Jun 05
0
Branch 'as' - 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_scope.h
...SwfdecAsContextClass *klass; void (* step) (SwfdecAsContext *context); + gboolean check_scope; /* some opcodes avoid a scope check */ g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context)); if (context->frame == NULL) @@ -437,6 +438,7 @@ start: startpc = script->buffer->data; endpc = startpc + script->buffer->length; pc = frame->pc; + check_scope = TRUE; while (TRUE) { if (pc == endpc) { @@ -447,6 +449,8 @@ start: SWFDEC_ERROR ("pc %p not in valid range [%p, %p) anymore", pc, startpc, endpc); goto error; } + if (check_sco...
2007 Apr 12
0
Branch 'as' - 15 commits - 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 libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...--git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index e88c30d..e38d9ba 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -386,7 +386,6 @@ start: pc = frame->pc; while (TRUE) { - g_print ("pc is %p\n", pc); if (pc == endpc) { swfdec_as_context_return (context); goto start; diff-tree 096cfd1d49808ca78c06a2db0f3fe4ac9cd94dc6 (from 605184459c5be15046a75e42ef912f0d12a7ecf6) Author: Benjamin Otte <otte@gnome.org> Date: Thu Apr 12 13:38:28 2007 +0200 copy the name of the calling script diff --gi...
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
...,9 +352,11 @@ start: return; script = frame->script; stack = frame->stack; - version = EXTRACT_VERSION (script->version); + version = SWFDEC_AS_EXTRACT_SCRIPT_VERSION (script->version); + context->version = script->version; startpc = script->buffer->data; endpc = startpc + script->buffer->length; + pc = frame->pc; while (TRUE) { if (pc == endpc) { @@ -383,7 +370,7 @@ start: /* decode next action */ action = *pc; - spec = actions + action; + spec = swfdec_as_actions + action; if (action == 0) break; if...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...while (swfdec_bits_left (bits) && (action = swfdec_bits_get_u8 (bits))) { if (action & 0x80) { len = swfdec_bits_get_u16 (bits); data = bits->ptr; @@ -1634,8 +1755,10 @@ swfdec_script_interpret (SwfdecScript *s while (TRUE) { /* check pc */ + if (pc == endpc) /* needed for scripts created via DefineFunction */ + break; if (pc < startpc || pc >= endpc) { - SWFDEC_ERROR ("pc %p not in valid range [%p, %p] anymore", pc, startpc, endpc); + SWFDEC_ERROR ("pc %p not in valid range [%p, %p) anymore", pc, startpc,...
2008 Apr 12
2
[Bug 15471] New: segmentation fault while seeking in youtube.com
...mber = 0, string = 0x0, object = 0x0}} frame = (SwfdecAsFrame *) 0xdce4670 last_frame = (SwfdecAsFrame *) 0x0 spec = (const SwfdecActionSpec *) 0xb230bd30 startpc = (const guint8 *) 0xb15cd08 "CWS\a?\206\001" pc = <value optimized out> endpc = (const guint8 *) 0xb1753de " ---Type <return> to continue, or q <return> to quit--- nextpc = (const guint8 *) 0xb170edc "\027\226\r" exitpc = (const guint8 *) 0xb170f0d "O\226\004" check = (SwfdecAsValue *) 0x0 action = 82...
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
...oto (movie, frame); movie->stopped = !play; @@ -315,6 +324,63 @@ swfdec_action_goto_frame2 (JSContext *cx return JS_TRUE; } +static void +swfdec_script_skip_actions (JSContext *cx, guint jump) +{ + SwfdecScript *script = cx->fp->swf; + guint8 *pc = cx->fp->pc; + guint8 *endpc = script->buffer->data + script->buffer->length; + + /* jump instructions */ + g_assert (script); + do { + if (pc >= endpc) + break; + if (*pc & 0x80) { + if (pc + 2 >= endpc) + break; + pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1))); + } else {...
2007 Oct 28
0
9 commits - configure.ac libswfdec/swfdec_as_context.c libswfdec/swfdec_audio_internal.h libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_sound.c
...frame); - pc = frame->pc; - if (frame != context->frame) - goto start; - } if (pc == exitpc) { swfdec_as_frame_return (frame, NULL); goto start; @@ -878,6 +871,13 @@ start: SWFDEC_ERROR ("pc %p not in valid range [%p, %p) anymore", pc, startpc, endpc); goto error; } + if (check_block && (pc < frame->block_start || pc >= frame->block_end)) { + SWFDEC_LOG ("code exited block"); + swfdec_as_frame_pop_block (frame); + pc = frame->pc; + if (frame != context->frame) + goto start;...
2007 Dec 02
2
[Bug 13491] New: 5min.com player causes assertion
...object = 0x2aaaafc59f61}} frame = (SwfdecAsFrame *) 0x36a5d80 last_frame = (SwfdecAsFrame *) 0x0 spec = <value optimized out> startpc = (const guint8 *) 0x2aaab0367de0 "CWS\b\004\023\b" pc = (const guint8 *) 0x4dc3f10 "" endpc = (const guint8 *) 0x2aaab03e90e4 "" nextpc = (const guint8 *) 0x2aaab0378406 "\226\002" exitpc = (const guint8 *) 0x2aaab037864f "O\226\004" check = <value optimized out> action = 82 len = <value optimized out>...
2007 Jan 26
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c
...cript (script->debugger, script); + return; + } if (script->refcount > 0) return; @@ -1266,13 +1304,37 @@ swfdec_script_interpret (SwfdecScript *s goto out; } - /* only valid return value */ while (TRUE) { /* check pc */ if (pc < startpc || pc >= endpc) { SWFDEC_ERROR ("pc %p not in valid range [%p, %p] anymore", pc, startpc, endpc); goto internal_error; } + + /* run interrupt handler */ + if (cx->runtime->interruptHandler) { + jsval tmp; + switch (cx->runtime->interruptHandler (cx, NULL, p...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...t_define_function, 0, -1, { NULL, NULL, NULL, swfdec_action_define_function, swfdec_action_define_function } }, [0x8f] = { "Try", NULL }, /* version 5 */ [0x94] = { "With", NULL }, @@ -2560,7 +2581,10 @@ swfdec_script_interpret (SwfdecScript *s guint8 *startpc, *pc, *endpc, *nextpc; JSBool ok = JS_TRUE; void *mark; - jsval *startsp, *endsp, *checksp; + jsval *startsp; +#ifndef G_DISABLE_ASSERT + jsval *checksp; +#endif int stack_check; guint action, len; guint8 *data; @@ -2636,8 +2660,8 @@ swfdec_script_interpret (SwfdecScript *s goto out; }...
2007 Dec 10
0
5 commits - libswfdec/jpeg libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_cached.c libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_flash_security.c libswfdec/swfdec_image.c
...ITE_MOVIE (cx->frame->target)) { SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target); swfdec_sprite_movie_goto (movie, frame + 1); @@ -225,7 +225,7 @@ swfdec_script_skip_actions (SwfdecAsContext *cx, guint jump) if (*pc & 0x80) { if (pc + 2 >= endpc) break; - pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1))); + pc += 3 + (pc[1] | (pc[2] << 8)); } else { pc++; } @@ -1086,11 +1086,14 @@ swfdec_action_not (SwfdecAsContext *cx, guint action, const guint8 *data, guint static void swfdec_action_jump (SwfdecAsCo...
2007 Jul 02
0
Branch 'as' - 24 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...;frame == NULL || context->state == SWFDEC_AS_CONTEXT_ABORTED) return; klass = SWFDEC_AS_CONTEXT_GET_CLASS (context); @@ -627,7 +627,7 @@ start: pc = frame->pc; check_scope = TRUE; - while (TRUE) { + while (context->state < SWFDEC_AS_CONTEXT_ABORTED) { if (pc == endpc) { swfdec_as_frame_return (frame); goto start; diff-tree ac1343606dba8169ab163a97a564cde0bbe22a7a (from 2e1af44affe8e070f1f649c5f36fb922015a003f) Author: Benjamin Otte <otte at gnome.org> Date: Sun Jul 1 00:31:34 2007 +0100 the frame can be NULL, too diff --git a/libswfd...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...44 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -762,14 +762,12 @@ swfdec_as_context_run (SwfdecAsContext *context) SwfdecAsFrame *frame, *last_frame; SwfdecScript *script; const SwfdecActionSpec *spec; - SwfdecActionExec exec; const guint8 *startpc, *pc, *endpc, *nextpc, *exitpc; #ifndef G_DISABLE_ASSERT SwfdecAsValue *check; #endif guint action, len; const guint8 *data; - int version; guint original_version; void (* step) (SwfdecAsDebugger *debugger, SwfdecAsContext *context); gboolean check_block; /* some opcodes avoid a scope check...