/* Capture .shader_test files. */
const char *capture_path = _mesa_get_shader_capture_path();
- if (shProg->Name != 0 && capture_path != NULL) {
+ if (shProg->Name != 0 && shProg->Name != ~0 && capture_path != NULL) {
FILE *file;
char filename[PATH_MAX];