mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
fix for 147929: [PATCH] running gst-register in non-utf8 locale can cause invalid registry
Original commit message from CVS: fix for 147929: [PATCH] running gst-register in non-utf8 locale can cause invalid registry
This commit is contained in:
parent
b515b8a729
commit
f8e7ca6ea9
2 changed files with 24 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
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>
|
2004-07-20 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
patch by: Wim Taymans
|
patch by: Wim Taymans
|
||||||
|
|
|
@ -134,14 +134,25 @@ __gst_element_details_clear (GstElementDetails * dp)
|
||||||
dp->author = NULL;
|
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
|
void
|
||||||
__gst_element_details_set (GstElementDetails * dest,
|
__gst_element_details_set (GstElementDetails * dest,
|
||||||
const GstElementDetails * src)
|
const GstElementDetails * src)
|
||||||
{
|
{
|
||||||
dest->longname = g_strdup (src->longname);
|
VALIDATE_SET (dest, src, longname);
|
||||||
dest->klass = g_strdup (src->klass);
|
VALIDATE_SET (dest, src, klass);
|
||||||
dest->description = g_strdup (src->description);
|
VALIDATE_SET (dest, src, description);
|
||||||
dest->author = g_strdup (src->author);
|
VALIDATE_SET (dest, src, author);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -151,6 +162,7 @@ __gst_element_details_copy (GstElementDetails * dest,
|
||||||
__gst_element_details_clear (dest);
|
__gst_element_details_clear (dest);
|
||||||
__gst_element_details_set (dest, src);
|
__gst_element_details_set (dest, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_element_factory_cleanup (GstElementFactory * factory)
|
gst_element_factory_cleanup (GstElementFactory * factory)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue