Permalink
Browse files

input: handle error in stream_ReadLine()

  • Loading branch information...
Rémi Denis-Courmont
Rémi Denis-Courmont committed Jun 21, 2017
1 parent 11b66ab commit a672ea060efbb5898e1d80327f5909a43e8b57d8
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/input/stream.c
@@ -210,10 +210,13 @@ char *vlc_stream_ReadLine( stream_t *s )
if( psz_encoding != NULL )
{
msg_Dbg( s, "UTF-16 BOM detected" );
priv->text.char_width = 2;
priv->text.conv = vlc_iconv_open( "UTF-8", psz_encoding );
if( priv->text.conv == (vlc_iconv_t)-1 )
if( unlikely(priv->text.conv == (vlc_iconv_t)-1) )
{
msg_Err( s, "iconv_open failed" );
goto error;
}
priv->text.char_width = 2;
}
}

0 comments on commit a672ea0

Please sign in to comment.