fix Issue 11137 - Stack overflow on invalid output path