Stream filter recursion stack overflow
There is no limit to recursion within the chain of stream filter. This can lead to stack overflow. One way to trigger it is by recursively gzip-compressing a file thounsands of times:
ASAN:DEADLYSIGNAL
=================================================================
==14813==ERROR: AddressSanitizer: stack-overflow on address 0x7fb163a61ff8 (pc 0x7fb17e26fcd9 bp 0x7fb163a62020 sp 0x7fb163a61fe0 T4)
ASAN:DEADLYSIGNAL
==14813==AddressSanitizer: while reporting a bug found another one. Ignoring.
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x7fb17e26fcd8 in vlc_stream_vaControl ../../src/input/stream.c:611
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x7fb17266e43d in Control ../../modules/stream_filter/inflate.c:131
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0x7fb17e27002e in vlc_stream_vaControl ../../src/input/stream.c:640
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x7fb17266e43d in Control ../../modules/stream_filter/inflate.c:131
(...)
SUMMARY: AddressSanitizer: stack-overflow ../../src/input/stream.c:611 in vlc_stream_vaControl
Thread T4 created by T3 here:
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x7fb17ef13f59 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x7fb17e379367 in vlc_clone_attr ../../src/posix/thread.c:482
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0x7fb17e379560 in vlc_clone ../../src/posix/thread.c:494
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x7fb17e241290 in input_Start ../../src/input/input.c:177
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0x7fb17e1a8ba0 in Preparse ../../src/playlist/preparser.c:249
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x7fb17e1a9ac1 in Thread ../../src/playlist/preparser.c:363
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x7fb17c6db463 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7463)
Thread T3 created by T0 here:
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) 0x7fb17ef13f59 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x7fb17e379367 in vlc_clone_attr ../../src/posix/thread.c:482
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) 0x7fb17e379786 in vlc_clone_detach ../../src/posix/thread.c:544
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x7fb17e1a769a in playlist_preparser_Push ../../src/playlist/preparser.c:118
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0x7fb17e144773 in libvlc_MetadataRequest ../../src/libvlc.c:631
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x7fb17e1b3903 in GoAndPreparse ../../src/playlist/item.c:794
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x7fb17e1b0b6a in playlist_NodeAddInput ../../src/playlist/item.c:541
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) 0x7fb17e191740 in intf_InsertItem ../../src/interface/interface.c:180
[#8](https://code.videolan.org/videolan/vlc/-/issues/8) 0x7fb17e1444fc in GetFilenames ../../src/libvlc.c:604
[#9](https://code.videolan.org/videolan/vlc/-/issues/9) 0x7fb17e143b96 in libvlc_InternalInit ../../src/libvlc.c:484
[#10](https://code.videolan.org/videolan/vlc/-/issues/10) 0x7fb17ec19fb6 in libvlc_new ../../lib/core.c:59
[#11](https://code.videolan.org/videolan/vlc/-/issues/11) 0x55bf4f462546 in main ../../bin/vlc.c:228
[#12](https://code.videolan.org/videolan/vlc/-/issues/12) 0x7fb17c1522b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
==14813==ABORTING
The problem is not really new nor specific to stream filters. It has affecter the stream output chain and A/V filter chains since forever. But so far it was presumably only triggerable by the user configuring insane chains. Now it can be triggered automatically by the input byte stream.