search for: g_assert

Displaying 20 results from an estimated 198 matches for "g_assert".

Did you mean: i_assert
2007 Mar 22
0
7 commits - configure.ac doc/swfdec-docs.sgml libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_js_movie.c test/trace
...e.c @@ -116,7 +116,11 @@ mc_play (JSContext *cx, JSObject *obj, u { SwfdecMovie *movie; - movie = JS_GetPrivate(cx, obj); + movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE); + if (movie == NULL) { + SWFDEC_WARNING ("not a movie"); + return JS_TRUE; + } g_assert (movie); movie->stopped = FALSE; @@ -128,8 +132,11 @@ mc_stop (JSContext *cx, JSObject *obj, u { SwfdecMovie *movie; - movie = JS_GetPrivate(cx, obj); - g_assert (movie); + movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE); + if (movie == NULL) { + SWFDEC_WARNI...
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...; +#define SWFDEC_BITS_CHECK(b,n) G_STMT_START { \ + if (swfdec_bits_left(b) < (n)) { \ + SWFDEC_ERROR ("reading past end of buffer"); \ + b->ptr = b->end; \ + b->idx = 0; \ + return 0; \ + } \ +}G_STMT_END +#define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \ + g_assert (b->end >= 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_in...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_resource.c
...static void +swfdec_movie_set_constructor (SwfdecSpriteMovie *movie) { - SwfdecPlayer *player; + SwfdecMovie *mov = SWFDEC_MOVIE (movie); + SwfdecAsContext *context = SWFDEC_AS_OBJECT (movie)->context; + SwfdecAsObject *constructor = NULL; - g_return_if_fail (SWFDEC_IS_MOVIE (movie)); + g_assert (mov->resource != NULL); - player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context); - g_queue_remove (player->init_queue, movie); - swfdec_movie_execute_script (movie, SWFDEC_EVENT_INITIALIZE); -} + if (movie->sprite) { + const char *name; -/** - * swfdec_movie_run_constru...
2007 Oct 31
0
2 commits - libswfdec/swfdec_sound.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie_html.c
...l (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (SWFDEC_IS_TEXT_FORMAT (format)); g_return_if_fail (start_index < end_index); - g_return_if_fail (end_index <= (guint) g_utf8_strlen (text->input->str, -1)); + g_return_if_fail (end_index <= text->input->len); g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); @@ -1051,7 +1051,7 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, findex_end_index = ((SwfdecFormatIndex *)iter->next->data)->index_; } else { - findex_end_index = g_utf...
2007 Feb 19
0
22 commits - libswfdec/js libswfdec/swfdec_debugger.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_script.c
...SET_PROPERTY (cx, obj, (jsid) atom, ret); } diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index d46687f..824861b 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1643,11 +1643,11 @@ swfdec_action_define_local (JSContext *c { const char *name; - g_assert (cx->fp->callobj != NULL); + g_assert (cx->fp->scopeChain != NULL); name = swfdec_js_to_string (cx, cx->fp->sp[-2]); if (name == NULL) return JS_FALSE; - if (!JS_SetProperty (cx, cx->fp->callobj, name, &cx->fp->sp[-1])) + if (!JS_SetProperty (cx, cx-&...
2007 Feb 08
0
3 commits - libswfdec/swfdec_loader.c libswfdec/swfdec_script.c libswfdec/swfdec_video.c
...script.c b/libswfdec/swfdec_script.c index c416f64..74b9934 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -109,7 +109,12 @@ swfdec_constant_pool_get_area (SwfdecScr return NULL; start = (guint8 *) g_ptr_array_index (pool, 0) - 5; buffer = script->buffer; - g_assert (start >= buffer->data); + if (start < buffer->data) { + /* DefineFunction inside DefineFunction */ + g_assert (buffer->parent != NULL); + buffer = buffer->parent; + g_assert (start >= buffer->data); + } g_assert (start + 3 < buffer->data + buffer->...
2007 Dec 13
0
libswfdec-gtk/swfdec_gtk_player.c libswfdec/swfdec_as_date.c libswfdec/swfdec_audio.c libswfdec/swfdec_audio_event.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_interval.c libswfdec/swfdec_key_as.c libswfdec/swfdec_mouse_as.c libswfdec/swfdec_movie.c
...tream->next_time - stream->current_time); + stream->timeout.timestamp = player->priv->time + SWFDEC_MSECS_TO_TICKS (stream->next_time - stream->current_time); swfdec_player_add_timeout (player, &stream->timeout); if (stream->flvdecoder->audio) { g_assert (stream->audio == NULL); diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c index 2c5f47c..efe2798 100644 --- a/libswfdec/swfdec_player.c +++ b/libswfdec/swfdec_player.c @@ -242,8 +242,10 @@ static SwfdecTick swfdec_player_get_next_event_time (SwfdecPlayer *player) { - if (pl...
2007 Feb 22
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_js.c libswfdec/swfdec_js_mouse.c libswfdec/swfdec_listener.c libswfdec/swfdec_listener.h libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...args diff --git a/player/swfdec_player_manager.c b/player/swfdec_player_manager.c index 82d55ed..31e9772 100644 --- a/player/swfdec_player_manager.c +++ b/player/swfdec_player_manager.c @@ -325,6 +325,7 @@ swfdec_player_manager_send_message (Swfd const char * parse_skip (const char *input) { + g_assert (input); if (g_ascii_isspace (*input)) input++; return input; @@ -336,6 +337,8 @@ parse_string (const char *input, char ** const char *start = input; g_assert (output); + if (input == NULL) + return NULL; while (*input && !g_ascii_isspace (*input)) input++;...
2007 Jun 27
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c
...ec_sprite_movie_init_movie (SwfdecMovie *mov) { SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (mov); - SwfdecAsContext *context; - SwfdecAsObject *constructor; - const char *name; + SwfdecAsContext *context = SWFDEC_AS_OBJECT (movie)->context; + SwfdecAsObject *constructor = NULL; - g_assert (movie->sprite->parse_frame > 0); g_assert (mov->swf != NULL); - movie->n_frames = movie->sprite->n_frames; - name = swfdec_swf_instance_get_export_name (mov->swf, - SWFDEC_CHARACTER (movie->sprite)); - context = SWFDEC_AS_OBJECT (movie)->context; - if (n...
2007 Oct 14
3
libswfdec/swfdec_player.c
...ndling keys ooooops diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c index 32254ab..4980b21 100644 --- a/libswfdec/swfdec_player.c +++ b/libswfdec/swfdec_player.c @@ -1023,6 +1023,7 @@ swfdec_player_do_handle_key (SwfdecPlayer *player, guint keycode, guint characte { g_assert (keycode < 256); + swfdec_player_lock (player); /* set the correct variables */ player->last_keycode = keycode; player->last_character = character; @@ -1032,6 +1033,8 @@ swfdec_player_do_handle_key (SwfdecPlayer *player, guint keycode, guint characte player->key_pressed...
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
...b/libswfdec/swfdec_as_types.h index 533df03..fe25c3f 100644 --- a/libswfdec/swfdec_as_types.h +++ b/libswfdec/swfdec_as_types.h @@ -60,22 +60,25 @@ struct _SwfdecAsValue { #define SWFDEC_AS_VALUE_IS_BOOLEAN(val) ((val)->type == SWFDEC_TYPE_AS_BOOLEAN) #define SWFDEC_AS_VALUE_GET_BOOLEAN(val) (g_assert ((val)->type == SWFDEC_TYPE_AS_BOOLEAN), (val)->value.boolean) #define SWFDEC_AS_VALUE_SET_BOOLEAN(val,b) G_STMT_START { \ - (val)->type = SWFDEC_TYPE_AS_BOOLEAN; \ - (val)->value.boolean = b; \ + SwfdecAsValue *__val = (val); \ + (__val)->type = SWFDEC_TYPE_AS_BOOLEAN; \ + (__...
2007 Feb 01
0
Branch 'interpreter' - libswfdec/swfdec_script.c
...(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 { + pc++; + } + } while (jump-- > 0); + cx->fp->pc = pc; +} + +static JSBool +swfd...
2007 Sep 08
0
9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_video_movie_as.c
...OLON, ++ SLASH ++ } token = START; ++ enum { ++ STARTING = (1 << 0), ++ SLASHES = (1 << 1), ++ WAS_SLASH = (1 << 2), ++ DOTS = (1 << 3), ++ COLONS = (1 << 4), ++ DOUBLE = (1 << 5), ++ BACKS = (1 << 6) ++ } flags = STARTING; ++ ++ g_assert (path != NULL); /* shortcut for the general case */ if (strpbrk (path, ".:/") == NULL) { @@@ -456,97 -438,98 +473,100 @@@ return TRUE; } -- /* in general, any combination of dot, colon and slash is allowed, but there -- * is some weird stuff that is not allowed....
2007 Oct 15
0
6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
...rmat *format, guint start_index, guint end_index) { - SwfdecFormatIndex *findex, *findex_new; + SwfdecFormatIndex *findex, *findex_new, *findex_prev; guint findex_end_index; GSList *iter, *next; @@ -698,10 +698,13 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); g_assert (((SwfdecFormatIndex *)text->formats->data)->index == 0); + + findex = NULL; for (iter = text->formats; iter != NULL && ((SwfdecFormatIndex *)iter->data)->index < end_ind...
2007 Dec 13
0
2 commits - libswfdec/swfdec_flash_security.c libswfdec/swfdec_flash_security.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c libswfdec/swfdec_resource_request.c libswfdec/swfdec_resource_request.h libswfdec/swfdec_security.h
...t_resource_perform_load_abort_callback (SwfdecPlayer *player, + gpointer data) +{ + SwfdecResourceRequest *request = data; + + swfdec_resource_request_free (request); +} + +static void swfdec_request_resource_perform_load (SwfdecPlayer *player, SwfdecResourceRequest *request) { - g_assert (player->resource); + g_assert (player->priv->resource); swfdec_player_request_resource_now (player, request->security, request->url, request->request, request->buffer, - swfdec_request_resource_perform_load_callback, request); + swfdec_request_resourc...
2007 Jan 18
0
Branch 'interpreter' - 2 commits - libswfdec/js libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
..._ERROR ("no movie for WaitForFrame"); + return JS_TRUE; + } + + frame = GUINT16_FROM_LE (*((guint16 *) data)); + jump = data[2]; + if (SWFDEC_IS_ROOT_MOVIE (movie)) { + SwfdecDecoder *dec = SWFDEC_ROOT_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 instruc...
2007 Aug 01
0
9 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_frame.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loader_internal.h libswfdec/swfdec_loadertarget.c libswfdec/swfdec_loadertarget.h libswfdec/swfdec_movie.c
...+swfdec_xml_loader_target_eof (SwfdecLoaderTarget *target, SwfdecLoader *loader) +{ + SwfdecXml *xml = SWFDEC_XML (target); + guint size; /* get the text from the loader */ - if (loader->state == SWFDEC_LOADER_STATE_ERROR) { - /* nothing to do here */ - } else { - guint size; - g_assert (loader->state == SWFDEC_LOADER_STATE_EOF); - swfdec_loader_set_data_type (loader, SWFDEC_LOADER_DATA_TEXT); - size = swfdec_buffer_queue_get_depth (loader->queue); - xml->text = g_try_malloc (size + 1); - if (xml->text) { - SwfdecBuffer *buffer; - guint i = 0; -...
2007 Jan 29
0
3 commits - autogen.sh configure.ac player/.gitignore player/Makefile.am player/swfdec_playback_alsa.c player/swfdec_playback.c player/swfdec_playback_none.c
...snd_strerror (err)); \ - return retval; \ - } \ -}G_STMT_END - -/*** STREAMS ***/ - -static snd_pcm_uframes_t -write_player (Stream *stream, const snd_pcm_channel_area_t *dst, - snd_pcm_uframes_t offset, snd_pcm_uframes_t avail) -{ - /* FIXME: do a long path if this doesn't hold */ - g_assert (dst[1].first - dst[0].first == 16); - g_assert (dst[0].addr == dst[1].addr); - g_assert (dst[0].step == dst[1].step); - g_assert (dst[0].step == 32); - - memset (dst[0].addr + offset * dst[0].step / 8, 0, avail * 4); - swfdec_audio_render (stream->audio, dst[0].addr + offset * dst[0].step...
2007 Jun 17
0
Branch 'as' - 4 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_player.c
...-250,7 +250,6 @@ swfdec_as_context_gc (SwfdecAsContext *c g_return_if_fail (context->state != SWFDEC_AS_CONTEXT_NEW); SWFDEC_INFO ("invoking the garbage collector"); - g_print ("invoking the garbage collector\n"); klass = SWFDEC_AS_CONTEXT_GET_CLASS (context); g_assert (klass->mark); klass->mark (context); diff-tree c9fbb629a9fafe3cb05322ef3c7653085cd1ace9 (from parents) Merge: 40a2b740ee548eeed3bcbe19f80e3d4590cb4451 cd9873840a332c579bd8648cf1ce1f5d11ebb098 Author: Benjamin Otte <otte at gnome.org> Date: Sun Jun 17 21:48:29 2007 +0200 Merge...
2007 Aug 07
0
5 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_keys.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie_as.c player/swfdebug.c player/swfdec_debug_movies.c player/swfdec_debug_movies.h test/trace
...nt; - count++; - } - return -1; -} - static GtkTreePath * -swfdec_debug_movies_movie_to_path (SwfdecMovie *movie) +swfdec_debug_movies_node_to_path (GNode *node) { GtkTreePath *path; - gint i; - if (movie->parent) { - i = my_g_list_is_nth (movie->parent->list, movie); - g_assert (i >= 0); - path = swfdec_debug_movies_movie_to_path (movie->parent); - gtk_tree_path_append_index (path, i); - } else { - i = my_g_list_is_nth (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context)->roots, movie); - g_assert (i >= 0); - path = gtk_tree_path_new (); -...