[vlc-commits] stream_ReadLine: fix end of line detection on big-endian UTF-16

Pierre Ynard git at videolan.org
Thu Sep 17 06:10:25 CEST 2020


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Sep 17 06:09:06 2020 +0200| [1a954775549e23a8e1c3051157d14436d4055679] | committer: Pierre Ynard

stream_ReadLine: fix end of line detection on big-endian UTF-16

Lines would be split on non-breaking spaces (0x00A0) instead of line
feeds (0x000A).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a954775549e23a8e1c3051157d14436d4055679
---

 src/input/stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/input/stream.c b/src/input/stream.c
index 35c5a04870..b26283e267 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -263,7 +263,7 @@ char *vlc_stream_ReadLine( stream_t *s )
         else
         {
             const uint8_t *p_last = p_data + i_data - priv->text.char_width;
-            uint16_t eol = priv->text.little_endian ? 0x0A00 : 0x00A0;
+            uint16_t eol = priv->text.little_endian ? 0x0A00 : 0x000A;
 
             assert( priv->text.char_width == 2 );
             psz_eol = NULL;
@@ -279,7 +279,7 @@ char *vlc_stream_ReadLine( stream_t *s )
 
             if( psz_eol == NULL )
             {   /* UTF-16: 000D <CR> */
-                eol = priv->text.little_endian ? 0x0D00 : 0x00D0;
+                eol = priv->text.little_endian ? 0x0D00 : 0x000D;
                 for( const uint8_t *p = p_data; p <= p_last; p += 2 )
                 {
                     if( U16_AT( p ) == eol )



More information about the vlc-commits mailing list