[vlc-devel] [PATCH 2/8] stream_ReadLine: reset iconv state on conversion error
Rémi Denis-Courmont
remi at remlab.net
Wed Oct 21 12:32:58 CEST 2020
Le keskiviikkona 21. lokakuuta 2020, 6.23.01 EEST Pierre Ynard via vlc-devel a
écrit :
> Tested against UTF-16 lone surrogates, for which it seems to make no
> difference
>
>
> diff --git a/src/input/stream.c b/src/input/stream.c
> index 90651de..376cbc9 100644
> --- a/src/input/stream.c
> +++ b/src/input/stream.c
> @@ -350,6 +350,9 @@ char *vlc_stream_ReadLine( stream_t *s )
> {
> msg_Err( s, "conversion error: %s", vlc_strerror_c( errno )
> ); msg_Dbg( s, "original: %d, in %zu, out %zu", i_line, i_in, i_out ); +
> /* Reset state */
> + size_t r = vlc_iconv( priv->text.conv, NULL, NULL, NULL,
> NULL ); + VLC_UNUSED( r );
> }
> free( p_line );
> p_line = psz_new_line;
It seems suspicious that this ends up there rather than under the error label.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list