Calling SHConstructCompiler with the wrong output will cause a crash. This is
caused because ConstructCompiler in CodeGenHLSL.cpp or CodeGenGLSL.cpp return
NULL, which is dereferenced in line 151 of ShaderLang.cpp. I suggest a check
for NULL be added.
Current code (ShaderLang.cpp lines 151-154)
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(type, spec, output));
TCompiler* compiler = base->getAsCompiler();
if (compiler == 0)
return 0;
Suggested replacement which prevents the crash and behaves correctly:
TShHandleBase* base = static_cast<TShHandleBase*>(ConstructCompiler(type, spec, output));
if (base == 0)
return 0;
TCompiler* compiler = base->getAsCompiler();
if (compiler == 0)
return 0;
Original issue reported on code.google.com by achriste...@gmail.com on 10 Jul 2013 at 6:50
Original issue reported on code.google.com by
achriste...@gmail.com
on 10 Jul 2013 at 6:50