[Vorbis] Direct crash on ov_open

Michael Smith mlrsmith at gmail.com
Sun Apr 3 14:46:05 PDT 2005


On Apr 3, 2005 12:42 PM, Wessam Bahnassi <wbahnassi at inframez.com> wrote:
> Greetings,
> 
> I've just downloaded the Ogg/Vorbis Win32 SDK 'OggVorbis-win32sdk-1.0.1.zip' and
> made a test app to open an ogg file. But as soon as I call ov_open() the program
> crashes because of an access violation to address 0x00000010...
> This happens on both Release and Debug builds.

This sort of thing is most likely to be incompatibility between the
libraries and your executable, caused by how the two are linked (this
can happen on win32 systems in many ways, the most common is linking
against the wrong C runtime library).

> void main(void)

That's wrong, but won't be causing your problem in this case. main()
must return int.

> {
>         // Attempt to open the file
>         FILE *pFile = NULL;
>         pFile = fopen("C:\\IronDaimen.ogg","rb");
>         if (!pFile)
>                 return;
> 
>         OggVorbis_File ovFile;
>         memset(&ovFile,0,sizeof(ovFile));
> 
>         int iRetval = 0;
>         iRetval = ov_open(pFile,&ovFile,NULL,0);
>         if (iRetval != 0)
>         {
>                 fclose(pFile);
>                 return;
>         }
> 
> }

The rest of this looks fine, so it's probably a linking problem.

> 
> I link against the ogg/vorbis DLLs (tried both debug and release ones).
> This is really very frustrating... I tried several other files, but all crash.
> WinAmp plays them correctly, so it's not with the files I suppose...

Even if it were the files, if vorbisfile were crashing, that would be a bug.

Sorry I can't give you any more specific advice - hopefully one of the
windows developers on the list will be able to (I don't use windows
regularly myself, and you didn't give any details about what
development tools you're using).

Mike


More information about the Vorbis mailing list