Handle NULL file names.
--- a/mojoshader_preprocessor.c Tue Feb 10 17:29:36 2009 -0500
+++ b/mojoshader_preprocessor.c Tue Feb 10 17:30:52 2009 -0500
@@ -198,11 +198,14 @@
return 0;
memset(state, '\0', sizeof (IncludeState));
- state->filename = StrDup(ctx, fname);
- if (state->filename == NULL)
+ if (fname != NULL)
{
- Free(ctx, state);
- return 0;
+ state->filename = StrDup(ctx, fname);
+ if (state->filename == NULL)
+ {
+ Free(ctx, state);
+ return 0;
+ } // if
} // if
state->included = included;