mirror of https://github.com/mpv-player/mpv
stream: increase max_size to INT_MAX minus padding
No need to magic number limit, we can support up to INT_MAX with current code. Which should be more than enough.
This commit is contained in:
parent
d90a5ff17a
commit
a59b8edb96
|
@ -803,7 +803,7 @@ int stream_skip_bom(struct stream *s)
|
|||
struct bstr stream_read_complete(struct stream *s, void *talloc_ctx,
|
||||
int max_size)
|
||||
{
|
||||
if (max_size > 1000000000)
|
||||
if (max_size <= 0 || max_size > STREAM_MAX_READ_SIZE)
|
||||
abort();
|
||||
|
||||
int bufsize;
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
// it's guaranteed that you can seek back by <= of this size again.
|
||||
#define STREAM_BUFFER_SIZE 2048
|
||||
|
||||
// Maximum size of a complete read.
|
||||
#define STREAM_MAX_READ_SIZE (INT_MAX - 1)
|
||||
|
||||
// flags for stream_open_ext (this includes STREAM_READ and STREAM_WRITE)
|
||||
|
||||
// stream->mode
|
||||
|
|
Loading…
Reference in New Issue