mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
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.
This commit is contained in:
parent
780d62f19e
commit
7b16d4b3b2
@ -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;
|
||||
|
@ -79,6 +79,8 @@ static const struct m_struct_st stream_opts = {
|
||||
static int fill_buffer(stream_t *s, char* buffer, int max_len){
|
||||
if(s->pos > s->end_pos) /// don't past end of current track
|
||||
return 0;
|
||||
if (max_len < VCD_SECTOR_DATA)
|
||||
return -1;
|
||||
return vcd_read(s->priv,buffer);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user