From 0b0183adf5863a2a82c404408b3d575945f11a81 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 2 Jul 2007 22:51:10 +0000 Subject: [PATCH] Although bug 552 was complaining about behavior that was illegal anyway, added an additional proofing check to vorbisfile to aid a developer figuring out what he's doing wrong. svn path=/trunk/vorbis/; revision=13210 --- lib/vorbisfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index 4c192ee..c52f4be 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -414,7 +414,10 @@ static int _open_seekable2(OggVorbis_File *vf){ /* we can seek, so set out learning all about this file */ (vf->callbacks.seek_func)(vf->datasource,0,SEEK_END); vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource); - + + /* If seek_func is implemented, tell_func must also be implemented */ + if(vf->end==-1) return(OV_EINVAL); + /* We get the offset for the last page of the physical bitstream. Most OggVorbis files will contain a single logical bitstream */ end=_get_prev_page(vf,&og); -- 2.7.4