changeset 32505:9677da0cd9b2

Fix dvd:// fill_buffer function to actually write into the specified buffer and check that the buffer is sufficiently large.
author reimar
date Sat, 06 Nov 2010 19:37:13 +0000
parents 5ab4633a9d4d
children 85dd2718c84a
files stream/stream_dvd.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvd.c	Sat Nov 06 19:35:34 2010 +0000
+++ b/stream/stream_dvd.c	Sat Nov 06 19:37:13 2010 +0000
@@ -415,7 +415,10 @@
 
 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);