Skip to content

Conversation

@Xenius97
Copy link
Contributor

@Xenius97 Xenius97 commented Jan 22, 2026

Summary

Fixed crash in processLineAgainstMesh when processing models with colored meshes (no texture coordinates). The function now safely handles models without UV data by using barycentric coordinates as a fallback.
Fixes: #4632

Motivation

The function would crash with an access violation (0xC0000005) when called on certain models that only have vertex colors without texture coordinates (e.g., model IDs: 13656, 13606, 3081, 3060, 1784, 2070, 2077, 2122, 2742, 2772, 8146, 953, 1318, 2594, 2782, 2602, 2781).

Test plan

  • Models with textures: Returns correct UV coordinates and texture names (existing behavior preserved)
  • Models without textures (colored mesh only): Returns barycentric coordinates as UV
  • Problematic model IDs from crash report (2781, 2782, etc.): All now work correctly

Test script: The attached resource spawns a test object at (0, 0, 3). You can change the model ID at the beginning of the script. (Shader won't apply on these object, thats a different issue)
process_test.zip

gta_sa_3erIIBjOun.mp4

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@Xenius97 Xenius97 requested a review from a team as a code owner January 22, 2026 19:26
@FileEX FileEX added the bugfix Solution to a bug of any kind label Jan 22, 2026
@FileEX FileEX enabled auto-merge (squash) January 22, 2026 19:41
@FileEX FileEX merged commit 16cab21 into multitheftauto:master Jan 22, 2026
9 checks passed
Dutchman101 pushed a commit that referenced this pull request Jan 23, 2026
…#4662)

#### Summary
Fixed crash in `processLineAgainstMesh` when processing models with
colored meshes (no texture coordinates). The function now safely handles
models without UV data by using barycentric coordinates as a fallback.
Fixes: #4632

#### Motivation
The function would crash with an access violation (0xC0000005) when
called on certain models that only have vertex colors without texture
coordinates (e.g., model IDs: 13656, 13606, 3081, 3060, 1784, 2070,
2077, 2122, 2742, 2772, 8146, 953, 1318, 2594, 2782, 2602, 2781).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

processLineAgainstMesh() crash on several objects

2 participants