Hi,
I'm experiencing a crash in Texture::update. It happens on the line:
glCheck(glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
I am on MacOS 10.15.6 using SFML 2.5.1, self-built with CMake.
The crash is due to EXC_BAD_ACCESS.
Here's where it gets weird.
The image dimensions are 1403 x 132. Since each pixel is 4 bytes, we have a total data size of 740784 bytes. When debugging, the size of
Texture::m_pixels is exactly 740784 bytes.
Inside Texture::update(),
const Uint8* pixels is a valid pointer to the start of
Texture::m_pixels's internal buffer.
However the bad access crash is telling me it was trying to access a memory location 741376 bytes past
pixels. It's over-reading by 592 bytes for some reason.
Just to confirm the input arguments once more:
x = 0
y = 0
width = 1403
height = 132
I don't know anything about OpenGL but it doesn't make sense to me that it is reading more data than width * height * 4. Could another application be interfering somehow?
Thanks