cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

vector iterator not dereferencable #57

Closed Papirosnik closed 6 years ago

Papirosnik commented 6 years ago

I'm getting this exception on the attached svg. 0.451.svg.zip

igagis commented 6 years ago

@Papirosnik which svgren version do you use? Do you get this on Android? I could not reproduce on Linux so far...

Papirosnik commented 6 years ago

Today I've pulled v.0.4.54 and got this exception on windows. Will check now on android.

igagis commented 6 years ago

Ok, I'll try it on Windows

igagis commented 6 years ago

Reproduced on Windows, will investigate

Papirosnik commented 6 years ago

Hmm.. it's strange a bit. It works in my app even on windows and crashes only in your render_test

igagis commented 6 years ago

I think it fails only in debug build, because in release builds assertions are turned off

Papirosnik commented 6 years ago

it's not an assertion. it crashes here: ret.data.resize(src.width src.height sizeof(std::uint32_t)); ... ret.surface.data = &*ret.data.begin();

but for some reason width and heights are zero

igagis commented 6 years ago

It crashes on assertion inside operator* wehn trying to dereference data.begin(). Sizes are zero due to SVG contents, as far as I understand. But I will make a fix for that, it is pretty clear now what happens.

igagis commented 6 years ago

svgren version 0.4.55 released, please update and try.

Papirosnik commented 6 years ago

it works like a charm! Thank you