From 15259f1aadbe63f9c4e222f275494b6689f8693c Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 6 Nov 2010 19:35:34 +0000 Subject: stream_dvd: fill_buffer(): use given buffer, not stream's default Fix dvd:// fill_buffer function to actually write into the specified buffer and check that the buffer is sufficiently large. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32591 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32592 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'stream') 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); -- cgit v1.2.3