Skip to content

Conversation

@pierotofy
Copy link
Contributor

@pierotofy pierotofy commented Aug 18, 2025

Hi 👋

I think there's a problem initializing idxImages in the exportChunks function. Currently the resulting IIndexArr will be initialized to 2*chunk.images.size() size, causing a buffer overflow in SubScene().

There might be a better way to fix this, but this fixes the crash and runs the split functionality as expected.

It's kind of strange because the IIndexArr constructor looks correct on the surface, but:

bool Scene::ExportChunks(const ImagesChunkArr& chunks, const String& path, ARCHIVE_TYPE type) const
{
	FOREACH(chunkID, chunks) {
		const ImagesChunk& chunk = chunks[chunkID];
		std::cerr << "SIZE: " << chunk.images.size() << std::endl;
		IIndexArr idxImages(chunk.images.begin(), chunk.images.end(), true);
		std::cerr << "IDX SIZE: " << idxImages.size() << std::endl;
		exit(1);
SIZE: 66
IDX SIZE: 132
g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

cdcseacave added a commit that referenced this pull request Aug 19, 2025
@cdcseacave
Copy link
Owner

thank you @pierotofy for finding this bug, the last commit should fix it

@cdcseacave cdcseacave closed this Aug 19, 2025
pierotofy pushed a commit to pierotofy/openMVS that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants