summaryrefslogtreecommitdiffstats
path: root/stream/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream.c')
-rw-r--r--stream/stream.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 1ceb184c48..1048a8006d 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -29,7 +29,7 @@
#include "osdep/atomics.h"
#include "osdep/io.h"
-#include "talloc.h"
+#include "mpv_talloc.h"
#include "config.h"
@@ -500,7 +500,7 @@ int stream_fill_buffer(stream_t *s)
}
// Read between 1..buf_size bytes of data, return how much data has been read.
-// Return 0 on EOF, error, of if buf_size was 0.
+// Return 0 on EOF, error, or if buf_size was 0.
int stream_read_partial(stream_t *s, char *buf, int buf_size)
{
assert(s->buf_pos <= s->buf_len);
@@ -914,7 +914,7 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx,
int total_read = 0;
int padding = 1;
char *buf = NULL;
- int64_t size = stream_get_size(s);
+ int64_t size = stream_get_size(s) - stream_tell(s);
if (size > max_size)
return (struct bstr){NULL, 0};
if (size > 0)