mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
Fix a rare case of silence/0-read at the edge of some files
This was only noticeable in some FFmpeg files, since it uses an IO buffer size that didn't align with foobar's.
This commit is contained in:
parent
9d33b42584
commit
a79cc5546b
@ -49,13 +49,14 @@ static size_t read_the_rest_foo(uint8_t * dest, off_t offset, size_t length, FOO
|
||||
streamfile->validsize=0;
|
||||
|
||||
try {
|
||||
if(offset >= streamfile->m_file->get_size(*streamfile->p_abort)) {
|
||||
if(offset > streamfile->m_file->get_size(*streamfile->p_abort)) {
|
||||
/* Update offset at end of file */
|
||||
streamfile->offset = streamfile->m_file->get_size(*streamfile->p_abort);
|
||||
return length_read;
|
||||
}
|
||||
streamfile->m_file->seek(offset,*streamfile->p_abort);
|
||||
if (streamfile->m_file->is_eof(*streamfile->p_abort)) return length_read;
|
||||
//if (streamfile->m_file->is_eof(*streamfile->p_abort)) /* allow edge case of offset=filesize */
|
||||
// return length_read;
|
||||
} catch (...) {
|
||||
streamfile->offset = streamfile->m_file->get_size(*streamfile->p_abort);
|
||||
#ifdef PROFILE_STREAMFILE
|
||||
|
Loading…
x
Reference in New Issue
Block a user