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(pospos){ off_t x=pos-(s->pos-s->buf_len); if(x>=0){