diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-11-06 19:35:34 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-08 18:05:11 +0200 |
commit | 15259f1aadbe63f9c4e222f275494b6689f8693c (patch) | |
tree | defafc7369afed6d6f2dc0ba7924be58bb99167d /stream | |
parent | 040008b43f9f4ca756e05e5c2df6c7cac6ac2519 (diff) | |
download | mpv-15259f1aadbe63f9c4e222f275494b6689f8693c.tar.bz2 mpv-15259f1aadbe63f9c4e222f275494b6689f8693c.tar.xz |
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
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_dvd.c | 7 |
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); |