summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index bff5011e90..a302da81f1 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -374,9 +374,12 @@ static void dvd_close(dvd_priv_t *d)
dvd_set_speed(dvd_device_current, -1); /* -1 => restore default */
}
-static int fill_buffer(stream_t *s, char *but, int len)
+static int fill_buffer(stream_t *s, char *buf, int len)
{
- off_t pos=dvd_read_sector(s->priv,s->buffer);
+ off_t pos;
+ if (len < 2048)
+ return -1;
+ pos = dvd_read_sector(s->priv, buf);
if (pos < 0)
return -1;
s->pos = 2048*(pos - 1);