Skip to content

Conversation

@SzymonPrajs
Copy link

Guard ggml_metal_buffer_map against invalid slicing: bail out if max_tensor_size would make size_step underflow, and fail early if the mapping would require more than GGML_METAL_MAX_BUFFERS slices. This avoids potential infinite loops or buffer array overruns for very large mappings while keeping normal behavior unchanged.

Tests: bash ./ci/run.sh ./tmp/results ./tmp/mnt

AI: bug identified with Codex.

@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant