Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.1, 5.7.0
-
Ubuntu 16.04 LTS 64 bit
-
1e0395f73e624bf9d40f508acd3da08294006947 (qt/qtbase/5.12)
Description
- Have a simple program:
#include <QCoreApplication> #include <QImage> #include <QPainter> #include <QString> #include <QtSvg> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QImage image(200, 200, QImage::Format_RGB32); image.fill(0); QPainter painter(&image); QSvgRenderer renderer((QLatin1String(argv[1]))); renderer.render(&painter); image.save(QLatin1String(argv[2])); return 0; }
- Pass the attached malformed SVG file to this program.
It will quit with failed assert:1 __GI_raise raise.c 54 0x7f23ff69b418 2 __GI_abort abort.c 89 0x7f23ff69d01a 3 qt_message_fatal qlogging.cpp 1648 0x7f24000741ff 4 QMessageLogger::fatal qlogging.cpp 790 0x7f2400070252 5 qt_assert qglobal.cpp 2999 0x7f24000689d7 6 QRasterizer::rasterizeLine qrasterizer.cpp 755 0x7f2400a065b7 7 QRasterPaintEngine::stroke qpaintengine_raster.cpp 1613 0x7f240099a448 8 QPaintEngineEx::draw qpaintengineex.cpp 599 0x7f240098b4da 9 QPaintEngineEx::drawPath qpaintengineex.cpp 839 0x7f240098cf49 10 QPainter::drawPath qpainter.cpp 3386 0x7f24009b90ac 11 QSvgPath::draw qsvggraphics.cpp 163 0x7f2401eaabad 12 QSvgG::draw qsvgstructure.cpp 65 0x7f2401ed9d4c 13 QSvgTinyDocument::draw qsvgtinydocument.cpp 244 0x7f2401ee1ad8 14 QSvgTinyDocument::draw qsvgtinydocument.cpp 380 0x7f2401ee23be 15 QSvgRenderer::render qsvgrenderer.cpp 372 0x7f2401ee522e 16 main main.cpp 15 0x401325
It might not be possible to render this file correctly, but it should not trigger an assertion failure. The wrong value should probably be caught earlier on.