For example, when the input is an empty file. Leaving the source type as VKD3D_SHADER_SOURCE_NONE would cause (potential) subsequent get_source_type_info() calls to return NULL, resulting in a segmentation fault.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- programs/vkd3d-compiler/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index ab475617..9cb90cd5 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -663,11 +663,11 @@ int main(int argc, char **argv) { uint32_t token;
- if (options.preprocess_only) + if (options.preprocess_only || info.source.size < sizeof(token)) { options.source_type = VKD3D_SHADER_SOURCE_HLSL; } - else if (info.source.size >= sizeof(token)) + else { memcpy(&token, info.source.code, sizeof(token)); if (token == TAG_DXBC)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=117443
Your paranoid android.
=== debian11 (build log) ===
Task: Patch failed to apply
=== debian11 (build log) ===
Task: Patch failed to apply