I’ve run into a really strange bug with cutLoadPGMf. The image loads perfectly fine, but I get an error when attempting to free up the allocated memory:
float *h_f1 = NULL;
char *image_filename = "lena_bw.pgm";
char* image_path = cutFindFilePath(image_filename, argv[0]);
if (image_path == 0) {
printf("Unable to source file file\n");
exit(EXIT_FAILURE);
}
CUT_SAFE_CALL(cutLoadPGMf(image_path, &h_f1, &width, &height));
free(h_f1);
I get a heap corruption error on the last line. This occurs when I use my own custom PGM files with the loader. Even weirder, the simpleTextures example works just fine for me, but when I try to load the lena_bw.pgm file from that sample in my own code, I get a “DEBUG ASSERTION” error at the cutLoadPGMf line.
Absolutely no idea what could be happening, the code looks identical to me. The other strange thing is the exact same code worked just fine in Linux :blink:
Any help would be greatly appreciated!