I have this code:
m_soundintrobuffer.loadFromFile(DataLoader::getSoundPath(1));
m_soundintroplayer.setBuffer(m_soundintrobuffer);
The file is certainly loading correctly as it gives no console output relating to file loading, and when I comment out the second line the program runs fine.
However the second line is resulting in me getting this output:
First-chance exception at 0x7434364E (sfml-audio-2.dll) in Viscus Engine.exe: 0xC0000005: Access violation reading location 0x3F800011.
Unhandled exception at 0x7434364E (sfml-audio-2.dll) in Viscus Engine.exe: 0xC0000005: Access violation reading location 0x3F800011.
If it helps, after this my IDE (Visual Studio 2012 RC) brings up the file 'free.c' which contains:
/***
*free.c - free an entry in the heap
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* Defines the following functions:
* free() - free a memory block in the heap
*
*******************************************************************************/
#include <cruntime.h>
#include <malloc.h>
#include <winheap.h>
#include <windows.h>
#include <internal.h>
#include <mtdll.h>
#include <dbgint.h>
#include <rtcsup.h>
/***
*void free(pblock) - free a block in the heap
*
*Purpose:
* Free a memory block in the heap.
*
* Special ANSI Requirements:
*
* (1) free(NULL) is benign.
*
*Entry:
* void *pblock - pointer to a memory block in the heap
*
*Return:
* <void>
*
*******************************************************************************/
void __cdecl _free_base (void * pBlock)
{
int retval = 0;
if (pBlock == NULL)
return;
RTCCALLBACK(_RTC_Free_hook, (pBlock, 0));
retval = HeapFree(_crtheap, 0, pBlock); // <<<< It seems to be dying here
if (retval == 0)
{
errno = _get_errno_from_oserr(GetLastError());
}
}
64-bit windows 7, Visual Studio 2012 RC, compiling as multithreaded (non-dll) to avoid end users needing redistributables, non-static SFML, all DLLs for SFML, OpenAL and libsnd-file1 or whatever are present.
Sorry if this is some stupid mistake I've made. I hope not.
Also the types are right otherwise it'd presumably stop compiling rather than at runtime.