I do not understand what is causing the memory access error here.
I made this simple example which shows my problem:
#include <stdlib.h>
typedef struct mycanvas {
void *pixels;
} mycanvas;
main()
{
void* testchunk;
testchunk = (void*) calloc (1024 * 768 * 4,sizeof(char));
struct mycanvas* new_canvas;
new_canvas->pixels=testchunk; //causes memory access error
}
What needs to be changed to get it to run? This is gcc on Linux.