[vlc-devel] [PATCH 1/3] stream_ReadLine: don't close iconv handle on error

Pierre Ynard linkfanel at yahoo.fr
Tue Sep 29 14:09:28 CEST 2020


This left the text encoding parameters in an inconsistent state. When it
happened after a transient error, and vlc_stream_ReadLine() was called
again afterwards, it would result in text conversion constantly failing
and no output getting returned anymore, rendering the rest of the stream
unsuable through this API.

There is no reason to close the handle there; it is properly closed when
the stream is destroyed anyway.


diff --git a/src/input/stream.c b/src/input/stream.c
index b26283e..05ea1a7 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -366,13 +366,6 @@ char *vlc_stream_ReadLine( stream_t *s )
 error:
     /* We failed to read any data, probably EOF */
     free( p_line );
-
-    /* */
-    if( priv->text.conv != (vlc_iconv_t)(-1) )
-    {
-        vlc_iconv_close( priv->text.conv );
-        priv->text.conv = (vlc_iconv_t)(-1);
-    }
     return NULL;
 }
 
-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list