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

Pierre Ynard linkfanel at yahoo.fr
Wed Sep 30 20:58:05 CEST 2020


> If it's not that, then I don't understand what error you are trying to
> handle.
> 
> AFAIK, the only other possible non-initial state would be a missing
> byte to form a codepoint. That should only be possible at EOF.

I thought I had explained. But it seems we're in agreement anyway.
This is not trying to handle encoding errors. The code that this patch
removes wasn't called to handle encoding errors, it was gratuitiously
destroying the converter on anything but encoding errors, which is most
definitely wrong regardless of what should be done about actual encoding
errors; handling of those remains unchanged.

> Either way, I think the correct error action is to reset the
> converter, not to keep it as is (nor to delete it as the current code
> does).

The current code doesn't delete the converter on conversion error, it
does nothing to it and just logs the error. We could change that part
too, but I don't know or see how that's going to help: the input will
still be wrong and unconvertible even after resetting the converter.

-- 
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