Reject oversized media before fully downloading it (#51896)
Signed-off-by: Clinton Thomas <1033162+KernelClint@users.noreply.github.com> Co-authored-by: Lucas Bourtoule <35483370+dhalf@users.noreply.github.com>
This commit is contained in:
co-authored by
Lucas Bourtoule
parent
585bb07c70
commit
2ec6f0d71e
@@ -79,6 +79,10 @@ class MediaIO(ABC, Generic[_T]):
|
||||
merged.update(runtime_kwargs)
|
||||
return merged
|
||||
|
||||
def get_max_bytes(self) -> int | None:
|
||||
"""Return the maximum encoded payload size accepted by this media IO."""
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def load_bytes(self, data: bytes) -> _T:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user