diff options
author | Nedeljko Babic <nbabic@mips.com> | 2012-03-27 11:40:24 +0200 |
---|---|---|
committer | Nedeljko Babic <nbabic@mips.com> | 2012-04-03 15:38:02 +0200 |
commit | 3ea17df4955268347f65f7fc3bd153fe4edbd1b5 (patch) | |
tree | b9ac9bb70ecf1e8d3b694756917341848ebc6c17 | |
parent | 2730389b0f05deb37e4f1abc42a736f61e8fa108 (diff) | |
download | tremor-3ea17df4955268347f65f7fc3bd153fe4edbd1b5.tar.gz |
Port r16328 and r16330 from libvorbis.
ivorbisfile_example.c ignores an error code and plows ahead blindly if
libvorbisidec reports the current bitstream section is bad (OV_EBADLINK).
Retrying after the error crashes libvorbisidec due to the unitialized state.
[Import part of the changes from Tremor (ff67c8b 2010-10-14)]
-rw-r--r-- | ivorbisfile_example.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ivorbisfile_example.c b/ivorbisfile_example.c index c99cfd2..7b0cf10 100644 --- a/ivorbisfile_example.c +++ b/ivorbisfile_example.c @@ -69,7 +69,12 @@ int main(){ /* EOF */ eof=1; } else if (ret < 0) { - /* error in the stream. Not a problem, just reporting it in + if(ret==OV_EBADLINK){ + fprintf(stderr,"Corrupt bitstream section! Exiting.\n"); + exit(1); + } + + /* some other error in the stream. Not a problem, just reporting it in case we (the app) cares. In this case, we don't. */ } else { /* we don't bother dealing with sample rate changes, etc, but |