summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b515b8a)
raw | patch | inline | side by side (parent: b515b8a)
author | Thomas Vander Stichele <thomas@apestaart.org> | |
Tue, 20 Jul 2004 10:18:48 +0000 (10:18 +0000) | ||
committer | Thomas Vander Stichele <thomas@apestaart.org> | |
Tue, 20 Jul 2004 10:18:48 +0000 (10:18 +0000) |
Original commit message from CVS:
fix for 147929: [PATCH] running gst-register in non-utf8 locale can cause invalid registry
fix for 147929: [PATCH] running gst-register in non-utf8 locale can cause invalid registry
ChangeLog | patch | blob | history | |
gst/gstelementfactory.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 439096e31b4b470f6f692ff915f1622570bdbd03..b199f926ee82a8c1b6415f6c8c7d9173625388d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2004-07-20 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ patch by: Benjamin Otte
+
+ * gst/gstelementfactory.c: (__gst_element_details_set):
+ fix for #147929: running gst-register in non-utf8 locale can cause
+ invalid registry
+
2004-07-20 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Wim Taymans
index 64305e66a151975503e129a24571b5674d98b94c..d6b072560836d3402fe3a602f72111b91c4159d1 100644 (file)
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
dp->author = NULL;
}
+#define VALIDATE_SET(__dest, __src, __entry) \
+G_STMT_START { \
+ if (g_utf8_validate (__src->__entry, -1, NULL)) { \
+ __dest->__entry = g_strdup (__src->__entry); \
+ } else { \
+ g_warning ("Invalid UTF-8 in " G_STRINGIFY (__entry) ": %s", \
+ __src->__entry); \
+ __dest->__entry = g_strdup ("[ERROR: invalid UTF-8]"); \
+ } \
+} G_STMT_END
+
void
__gst_element_details_set (GstElementDetails * dest,
const GstElementDetails * src)
{
- dest->longname = g_strdup (src->longname);
- dest->klass = g_strdup (src->klass);
- dest->description = g_strdup (src->description);
- dest->author = g_strdup (src->author);
+ VALIDATE_SET (dest, src, longname);
+ VALIDATE_SET (dest, src, klass);
+ VALIDATE_SET (dest, src, description);
+ VALIDATE_SET (dest, src, author);
}
void
__gst_element_details_clear (dest);
__gst_element_details_set (dest, src);
}
+
static void
gst_element_factory_cleanup (GstElementFactory * factory)
{