A
attibln
Hi,
I'm having an odd problem with a project using VisualStudio 2005 Prof.
When I execute the program below I get this message:
Debug Assertion Failed
Program: ...
File: dbgheap.c
Line: 1252
Expression: _CrtIsValidHeapPointer(pUserData)
---------- START ----------
#include "stdafx.h"
#include <iostream>
using namespace std;
int main( int argc, char * argv[] )
{
unsigned long lU_tile_size = 2956;
// read the tile data (jpeg file) into a buffer
unsigned char * byP_jpeg_file = (unsigned char *)
malloc( lU_tile_size );
if( byP_jpeg_file == NULL )
{
wcout << L"eek - allocating memory failed";
return 1;
}
// PROBLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEM
realloc( byP_jpeg_file , 0 );
return 0;
}
---------- END----------
VS2005 settings:
win32 command line executable
ATL is linked statically
Multithreaded-Debug (/MTd)
runtime checking: both
optimisation is turned off (/Od)
Please help!
~ Attila
I'm having an odd problem with a project using VisualStudio 2005 Prof.
When I execute the program below I get this message:
Debug Assertion Failed
Program: ...
File: dbgheap.c
Line: 1252
Expression: _CrtIsValidHeapPointer(pUserData)
---------- START ----------
#include "stdafx.h"
#include <iostream>
using namespace std;
int main( int argc, char * argv[] )
{
unsigned long lU_tile_size = 2956;
// read the tile data (jpeg file) into a buffer
unsigned char * byP_jpeg_file = (unsigned char *)
malloc( lU_tile_size );
if( byP_jpeg_file == NULL )
{
wcout << L"eek - allocating memory failed";
return 1;
}
// PROBLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEM
realloc( byP_jpeg_file , 0 );
return 0;
}
---------- END----------
VS2005 settings:
win32 command line executable
ATL is linked statically
Multithreaded-Debug (/MTd)
runtime checking: both
optimisation is turned off (/Od)
Please help!
~ Attila