summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/stream.h b/stream/stream.h
index 021296b247..cad61d3256 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -295,6 +295,10 @@ inline static int stream_seek(stream_t *s,off_t pos){
mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%qX\n",(long long)pos);
+ if (pos < 0) {
+ mp_msg(MSGT_DEMUX, MSGL_ERR, "Invalid seek to negative position!\n");
+ pos = 0;
+ }
if(pos<s->pos){
off_t x=pos-(s->pos-s->buf_len);
if(x>=0){