vkd3d-shader/dxil: Return an error from sm6_parser_globals_init() on invalid operand count.

This commit is contained in:
Conor McCarthy 2023-07-13 11:41:04 +10:00 committed by Alexandre Julliard
parent e0e261eac3
commit 8fe6d2eeac
Notes: Alexandre Julliard 2023-07-20 22:57:52 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/278

View File

@ -1767,7 +1767,8 @@ static enum vkd3d_result sm6_parser_globals_init(struct sm6_parser *sm6)
break;
case MODULE_CODE_VERSION:
dxil_record_validate_operand_count(record, 1, 1, sm6);
if (!dxil_record_validate_operand_count(record, 1, 1, sm6))
return VKD3D_ERROR_INVALID_SHADER;
if ((version = record->operands[0]) != 1)
{
FIXME("Unsupported format version %#"PRIx64".\n", version);