[vlc-commits] stream_ReadLine: don't set inconsistent encoding parameters on error
Pierre Ynard
git at videolan.org
Sat Oct 3 12:13:36 CEST 2020
vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Oct 3 12:02:38 2020 +0200| [e10e7d92403d5fbd09a268aff5c89a1da340f58e] | committer: Pierre Ynard
stream_ReadLine: don't set inconsistent encoding parameters on error
(cherry picked from commit f21515fc1851d50900433ccd6998338ea35f5e2d)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e10e7d92403d5fbd09a268aff5c89a1da340f58e
---
src/input/stream.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/input/stream.c b/src/input/stream.c
index a191a1de40..929666fc69 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -195,6 +195,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 */
@@ -205,7 +206,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 ) )
{
@@ -223,6 +224,7 @@ char *vlc_stream_ReadLine( stream_t *s )
goto error;
}
priv->text.char_width = 2;
+ priv->text.little_endian = little_endian;
}
}
More information about the vlc-commits
mailing list