Text:add("") throws assertion failed in debug build

Issue #1372 resolved
Tae Hanazono
created an issue

This bug also present in current 0.11.0 default branch

The problem is located in Text.cpp function Text::addTextData.
Here's example code to reproduce the issue

-- Text test
function love.load()
    text = love.graphics.newText(love.graphics.getFont())
    text:add("Hello world", 0, 0)
    text:add("", 0, 20) -- assertion failed here

function love.draw()
    love.graphics.draw(text, 10, 10)

The assertion failed message:

Debug Assertion Failed!

Program: C:\Windows\SYSTEM32\MSVCP140D.dll
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vector
Line: 1234

Expression: vector subscript out of range

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)

Comments (3)

  1. Log in to comment