[vorbis-dev] ov_open() Causing File Access Errors

Alan MacDonald newslists at warpzillion.com
Fri Dec 20 12:22:09 PST 2002



Dustin Smith wrote:
> In my BCB application, this code, when executed, has been eliciting an access
> violation error.  It works fine when just opening the filestream; the error seems
> to be from the ov_open() command.
> 
>    FILE* filePtr=fopen(FileListBox1->FileName.c_str(),"rw");
>    ov_open(filePtr,ovFile,NULL,0);
> 
> "Access violation at address 00401FA4 in program. Read of address 00000000" is the
> error.  Any ideas what this may be?  Thank you.

Two things to try. First, you should always check the return value of 
fopen() to make sure you actually have a valid FILE pointer. (I believe 
that's what's failing)  Secondly, if this is on Windows make sure you 
open with "rb" or "wb" to take care of the EOL handling.

Alan

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list