[Swfdec] 3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_movie_asprops.c
Benjamin Otte
company at kemper.freedesktop.org
Wed Oct 31 09:03:04 PDT 2007
libswfdec/swfdec_as_string.c | 6 ++++--
libswfdec/swfdec_load_object_as.c | 2 +-
libswfdec/swfdec_movie_asprops.c | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 55b46aeed956a99e3943cc468d33f7f2e10dbfa6
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Oct 31 17:02:00 2007 +0100
memleak
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index fd326ac..5fc31f3 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -638,12 +638,12 @@ swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg)
#define APPEND(chr) G_STMT_START{ \
g_byte_array_append (array, (guchar *) chr, 1); \
}G_STMT_END
- array = g_byte_array_new ();
in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
if (s == NULL) {
SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", msg);
return NULL;
}
+ array = g_byte_array_new ();
while (*s != 0) {
if (decoding) {
decoding++;
@@ -673,8 +673,10 @@ swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg)
s++;
}
g_free (in);
- if (array->len == 0)
+ if (array->len == 0) {
+ g_byte_array_free (array, TRUE);
return NULL;
+ }
cur = 0;
g_byte_array_append (array, (guchar *) &cur, 1);
out = g_convert ((char *) array->data, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
commit 2080dad70763409bb21d5f93b2e5f3efe47393d1
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Oct 31 16:59:34 2007 +0100
fix memleak
diff --git a/libswfdec/swfdec_movie_asprops.c b/libswfdec/swfdec_movie_asprops.c
index deb8d7a..990ccf3 100644
--- a/libswfdec/swfdec_movie_asprops.c
+++ b/libswfdec/swfdec_movie_asprops.c
@@ -380,6 +380,7 @@ mc_target_get (SwfdecMovie *movie, SwfdecAsValue *rval)
}
if (s->len == 0) {
SWFDEC_AS_VALUE_SET_STRING (rval, SWFDEC_AS_STR_SLASH);
+ g_string_free (s, TRUE);
} else {
SWFDEC_AS_VALUE_SET_STRING (rval, swfdec_as_context_give_string (
SWFDEC_AS_OBJECT (movie)->context, g_string_free (s, FALSE)));
commit 95923db82b9a6495360a1b0b10f2ea4fe8df5393
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Oct 31 16:59:01 2007 +0100
handle the case where this is NULL
diff --git a/libswfdec/swfdec_load_object_as.c b/libswfdec/swfdec_load_object_as.c
index 335bf6b..045eb0d 100644
--- a/libswfdec/swfdec_load_object_as.c
+++ b/libswfdec/swfdec_load_object_as.c
@@ -36,7 +36,7 @@ swfdec_load_object_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc,
{
const char *url;
- if (argc < 1) {
+ if (argc < 1 || obj == NULL) {
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, FALSE);
return;
}
More information about the Swfdec
mailing list