1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

[devalue] avoid infinite loop

Authored by: bashonly
This commit is contained in:
bashonly 2025-06-11 02:19:19 -05:00
parent cc6111b31b
commit 363c68d3ed
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

View File

@ -71,6 +71,9 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal
if value and isinstance(value[0], str):
# TODO: implement zips `strict=True`
if reviver := revivers.get(value[0]):
if value[1] == source:
yield IndexError('custom types cannot point to themselves')
continue
# inverse order: resolve index, revive value
stack.append((target, index, (value[0], value[1], reviver)))
stack.append((target, index, value[1]))