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)