Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad alloc! #1

Closed
zvezdochiot opened this issue Apr 4, 2020 · 3 comments
Closed

Bad alloc! #1

zvezdochiot opened this issue Apr 4, 2020 · 3 comments

Comments

@zvezdochiot
Copy link
Collaborator

zvezdochiot commented Apr 4, 2020

int ** mask = (int **)calloc(int(height), sizeof(int*));
for (int i = 0; i<width; i++)
mask[i] = (int *)calloc(int(width), sizeof(int));

Maybe?:

	int ** mask = (int **)calloc(int(height), sizeof(int*));
	for (int i = 0; i < height; i++)
            mask[i] = (int *)calloc(int(width), sizeof(int));

See:

//free memory
for (int i = 0; i < height; ++i)
free(mask[i]);
free(mask);

@ZQPei
Copy link
Owner

ZQPei commented Apr 4, 2020

I think you are probably right. The images I use are square, so I did not see this bug.

@zvezdochiot
Copy link
Collaborator Author

ZQPei added a commit that referenced this issue Apr 4, 2020
Fix bugs in Issue #1
@zvezdochiot
Copy link
Collaborator Author

Fixed. :)

zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/patchmatch_inpainting that referenced this issue Dec 24, 2022
Fix bugs in Issue ZQPei#1
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

No branches or pull requests

2 participants