[vlc-commits] stream_ReadLine: don't gratuitiously close iconv handle on unrelated error

Pierre Ynard git at videolan.org
Tue Oct 27 09:17:20 CET 2020


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Oct 27 08:44:29 2020 +0100| [a66f141b17e792bcc298c83496749ec93265ff14] | committer: Pierre Ynard

stream_ReadLine: don't gratuitiously close iconv handle on unrelated error

The only errors after which this was called were memory allocation
errors, lines too long, or failing to open the handle itself, so
obviously there is no reason to want to close it there; it already gets
closed in the proper place when the stream is destroyed.

Even worse, it left the handle missing if vlc_stream_ReadLine() was
called again, and would result in text conversion constantly failing and
no output getting returned anymore, rendering the rest of the stream
unusable through this API and precluding any error recovery.

(cherry picked from commit 520e79aa6e9d68de56352f701cd6eae7141cf20f)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

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

 src/input/stream.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/input/stream.c b/src/input/stream.c
index bc8cc221df..b94279b431 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -355,13 +355,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;
 }
 



More information about the vlc-commits mailing list