summaryrefslogtreecommitdiffstats
path: root/stream/stream_cdda.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-05 02:04:21 +0200
committerwm4 <wm4@nowhere>2013-06-09 22:06:03 +0200
commit7b16d4b3b2a46ea3314d0a2f9140f3359750770f (patch)
tree1628d42fc60e572ba161a396e7d58fe67d677fe2 /stream/stream_cdda.c
parent780d62f19eedc32814c17de6943196d1aab0f26e (diff)
downloadmpv-7b16d4b3b2a46ea3314d0a2f9140f3359750770f.tar.bz2
mpv-7b16d4b3b2a46ea3314d0a2f9140f3359750770f.tar.xz
stream_cdda, stream_vcd: check read buffer size
These assumed that the buffer provided with fill_buffer() was at least sector sized, instead of checking the size parameter. This is just a cleanup, since every caller made sure to align everything on sector sizes, if a stream has the sector size set.
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r--stream/stream_cdda.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index a99150f65d..1bec7dcc37 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -196,6 +196,9 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len)
int16_t *buf;
int i;
+ if (max_len < CDIO_CD_FRAMESIZE_RAW)
+ return -1;
+
if ((p->sector < p->start_sector) || (p->sector > p->end_sector)) {
s->eof = 1;
return 0;