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

findOutline4 function does not check itself for nonMaskValue #44

Open
derek-rocheleau opened this issue Nov 20, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@derek-rocheleau
Copy link

void MaskAnalyzer::findOutline4(const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, PixelPositions& outlinePixels4, const PixelBoundingBox& boundingBox, const uint8_t nonMaskValue)

The output for this function is described as this:

Resulting outline-4 pixels, the pixel itself is not a mask pixel but has at least one neighbor mask pixel in the four-neighborhood

But nowhere does it ensure that the pixel being analyzed is not a mask pixel. As a result the output contains all of the mask pixels in addition to the outline pixels. See Line 381 for example:

if (maskRow[x - 1u] != nonMaskValue || maskRow[x + 1u] != nonMaskValue || maskRowBottom[x] != nonMaskValue)

It is done correctly in other functions, such as here in Line 1784:

if (row1[x] != nonMaskValue && (row1[x - 1u] == nonMaskValue || row1[x + 1u] == nonMaskValue || row0[x] == nonMaskValue || row2[x] == nonMaskValue))

@derek-rocheleau derek-rocheleau added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant