Commit ff6e9662 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

subsdec: Fix unicode regression

parent 948aa6c7
......@@ -645,7 +645,17 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
return p_spu;
}
static bool AppendCharacter( text_segment_t* p_segment, wchar_t c )
static bool AppendCharacter( text_segment_t* p_segment, char c )
{
char* tmp;
if ( asprintf( &tmp, "%s%c", p_segment->psz_text ? p_segment->psz_text : "", c ) < 0 )
return false;
free( p_segment->psz_text );
p_segment->psz_text = tmp;
return true;
}
static bool AppendWideCharacter( text_segment_t* p_segment, wchar_t c )
{
char* tmp;
if ( asprintf( &tmp, "%s%lc", p_segment->psz_text ? p_segment->psz_text : "", c ) < 0 )
......@@ -1154,7 +1164,7 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
}
else if( !strncasecmp( psz_subtitle, "\\h", 2 ) )
{
if ( !AppendCharacter( p_segment, L'\u00A0' ) )
if ( !AppendWideCharacter( p_segment, L'\u00A0' ) )
goto fail;
psz_subtitle += 2;
}
......
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