Commit 3824ea57 authored by Steve Lhomme's avatar Steve Lhomme

libebml2: fix a potential crash in EBML_StringGet()

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@417 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 431aab45
......@@ -51,12 +51,20 @@ err_t EBML_StringSetValue(ebml_string *Element,const char *Value)
void EBML_StringGet(ebml_string *Element,tchar_t *Out, size_t OutLen)
{
if (!Element->Buffer)
{
if (OutLen)
*Out = 0;
}
else
{
#if defined(CONFIG_EBML_UNICODE)
if (Node_IsPartOf(Element,EBML_UNISTRING_CLASS))
Node_FromUTF8(Element,Out,OutLen,Element->Buffer);
else
if (Node_IsPartOf(Element,EBML_UNISTRING_CLASS))
Node_FromUTF8(Element,Out,OutLen,Element->Buffer);
else
#endif
Node_FromStr(Element,Out,OutLen,Element->Buffer);
Node_FromStr(Element,Out,OutLen,Element->Buffer);
}
}
static err_t ReadData(ebml_string *Element, stream *Input, const ebml_parser_context *ParserContext, bool_t AllowDummyElt, int Scope)
......
......@@ -3,7 +3,7 @@
GROUP ebml2_group
{
PROJECT_NAME "libebml2"
PROJECT_VERSION 0.9.8
PROJECT_VERSION 0.9.9
PROJECT_VENDOR "Matroska Foundation"
EXPDEFINE HAS_EBML2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment