File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
xivModdingFramework/Materials/FileTypes Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 14
14
// You should have received a copy of the GNU General Public License
15
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
17
+ using HelixToolkit . SharpDX . Core ;
17
18
using SharpDX ;
18
19
using System ;
19
20
using System . Collections . Generic ;
@@ -532,9 +533,16 @@ await Task.Run((Func<Task>)(async () =>
532
533
var offset = shaderParam . Offset ;
533
534
var size = shaderParam . Size ;
534
535
shaderParam . Bytes = new List < byte > ( ) ;
535
- for ( var idx = offset ; idx < offset + size ; idx ++ )
536
+ if ( offset + size <= shaderBytes . Length )
536
537
{
537
- shaderParam . Bytes . Add ( shaderBytes [ idx ] ) ;
538
+ for ( var idx = offset ; idx < offset + size ; idx ++ )
539
+ {
540
+ shaderParam . Bytes . Add ( shaderBytes [ idx ] ) ;
541
+ }
542
+ } else
543
+ {
544
+ // Just use a blank array if we have missing/invalid shader data.
545
+ shaderParam . Bytes = new List < byte > ( new byte [ size ] ) ;
538
546
}
539
547
}
540
548
You can’t perform that action at this time.
0 commit comments