diff options
author | Thomas Daede <daede003@umn.edu> | 2019-01-28 15:33:32 -0800 |
---|---|---|
committer | Thomas Daede <daede003@umn.edu> | 2019-01-28 15:33:32 -0800 |
commit | 603cd941ea32576bdbca33c9d5625d878cd0d1c9 (patch) | |
tree | eee3bf0bab991578706a9f1667dd6009182387d1 | |
parent | 128f0f812b39185d884c67c5f1c780b19aca34ac (diff) | |
download | libvorbis-git-603cd941ea32576bdbca33c9d5625d878cd0d1c9.tar.gz |
Port opus-tools check to see if underlying file was overwritten.
-rw-r--r-- | lib/vorbisfile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index 831cb39f..6b7bbee0 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -264,6 +264,10 @@ static ogg_int64_t _get_prev_page_serial(OggVorbis_File *vf, ogg_int64_t begin, } } } + /*We started from the beginning of the stream and found nothing. + This should be impossible unless the contents of the stream changed out + from under us after we read from it.*/ + if(!begin&&vf->offset<0)return OV_EBADLINK; } /* we're not interested in the page... just the serialno and granpos. */ |