Handle bad input file.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22194 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-06-26 22:42:55 +00:00
parent e369bfccfe
commit db4cd54dac

View File

@ -254,6 +254,11 @@ bool CompileFile(const char *fileName, ShHandle compiler, int debugOptions, cons
{
int ret;
char** shaderStrings = ReadFileData(fileName);
if (! shaderStrings) {
usage();
return false;
}
int* lengths = new int[NumShaderStrings];
// move to length-based strings, rather than null-terminated strings