Skip to content

Commit 861a337

Browse files
jrpriceDawn LUCI CQ
authored andcommitted
[ir] Catch invalid matrix element in decode
If the matrix element type was invalid, do not try to create the matrix column type. Fixed: 446116232 Change-Id: Ie72cc58ea9f51e499717c9eab930859d069373cf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/262555 Reviewed-by: dan sinclair <[email protected]> Commit-Queue: James Price <[email protected]>
1 parent 5a28377 commit 861a337

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tint/lang/core/ir/binary/decode.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,10 @@ struct Decoder {
781781
return mod_out_.Types().invalid();
782782
}
783783
auto* el_ty = Type(matrix_in.element_type());
784+
if (el_ty == nullptr) {
785+
err_ << "matrix element type is invalid\n";
786+
return mod_out_.Types().invalid();
787+
}
784788
auto* column_ty = mod_out_.Types().vec(el_ty, matrix_in.num_rows());
785789
return mod_out_.Types().mat(column_ty, matrix_in.num_columns());
786790
}

0 commit comments

Comments
 (0)