Skip to content
Snippets Groups Projects
Commit f21515fc authored by Pierre Ynard's avatar Pierre Ynard
Browse files

stream_ReadLine: don't set inconsistent encoding parameters on error

parent de403626
No related branches found
No related tags found
No related merge requests found
......@@ -210,6 +210,7 @@ char *vlc_stream_ReadLine( stream_t *s )
if( i_pos == 0 && i_data >= 2 )
{
const char *psz_encoding = NULL;
bool little_endian = false;
if( unlikely(priv->text.conv != (vlc_iconv_t)-1) )
{ /* seek back to beginning? reset */
......@@ -220,7 +221,7 @@ char *vlc_stream_ReadLine( stream_t *s )
if( !memcmp( p_data, "\xFF\xFE", 2 ) )
{
psz_encoding = "UTF-16LE";
priv->text.little_endian = true;
little_endian = true;
}
else if( !memcmp( p_data, "\xFE\xFF", 2 ) )
{
......@@ -238,6 +239,7 @@ char *vlc_stream_ReadLine( stream_t *s )
goto error;
}
priv->text.char_width = 2;
priv->text.little_endian = little_endian;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment