rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.65k stars 266 forks source link

Assertion failed when running harfbuzz demos #131

Closed schmittl closed 8 years ago

schmittl commented 8 years ago

Hi, I am getting the following output when trying to run the harfbuzz and hb-texture demos on Windows built with a msys2 MinGW 32 bit toolchain:

Starting harfbuzz.exe...

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Using GLEW 2.0.0
Assertion failed!

Program: harfbuzz\harfbuzz.exe
File: freetype-gl\texture-atlas.c, Line 118

Expression: data
harfbuzz\harfbuzz.exe exited with code 3

However, if I comment out the assert(data) on Line 118 both demos run without problems.

I just debugged the harfbuzz demo and noticed that it hits the assert when i = 7 which I think is the space character in the arabic string. I read somewhere that ft_bitmap.buffer is set to NULL when the bitmap is empty (e.g. for ' ').

The commit ddac468f69e0f92cecf5d621df6d4f485c90adc5 that added the assert statement was part of pr #128. But I do not know if it is actually needed to fix the issue in #126, it seems a bit suspicious to me.

Perhaps someone can reproduce this?

wmamrak commented 8 years ago

Hi, I acknowledge my mistake :D. PR waiting for approval.

schmittl commented 8 years ago

Thanks for the quick reply and the PR!

I can confirm that the patch fixes the issue for me.