diff --git a/ivorbisfile_example.c b/ivorbisfile_example.c index 7b0cf10..7f2ee21 100644 --- a/ivorbisfile_example.c +++ b/ivorbisfile_example.c @@ -29,7 +29,7 @@ #include #endif -char pcmout[4096]; /* take 4k out of the data segment, not the stack */ +short pcmout[2048]; /* take 4k out of the data segment, not the stack */ int main(){ OggVorbis_File vf; @@ -64,10 +64,14 @@ int main(){ } while(!eof){ - long ret=ov_read(&vf,pcmout,sizeof(pcmout),¤t_section); + long ret=ov_read(&vf,(char*)pcmout,sizeof(pcmout),¤t_section); if (ret == 0) { /* EOF */ eof=1; + } else if (ret == OV_EINVAL) { + /* something about this call was seriously wrong */ + fprintf(stderr, "Invalid data was passed to ov_read somehow\n"); + return(1); } else if (ret < 0) { if(ret==OV_EBADLINK){ fprintf(stderr,"Corrupt bitstream section! Exiting.\n");