﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
105	Division by zero in svghandler.cpp	Dmitry A. Kuminov		"The SVG module has a function, pathArc() defined in source:/trunk/src/svg/qsvghandler.cpp that uses its arguments as divisors w/o checking if they are zero or not.

This function is a reason why e.g. mp3diags traps. First of all, mp3diags somehow supplies a wrong SVG file to QIcon which contains these invalid zero arguments (this needs to be investigated, I suspect it's an OS/2 specific bug). Then, this function causes SIGFPE (which is originally XCPT_FLOAT_INVALID_OPERATION) because of division by zero.


The obvious fix is to replace
{{{
    rx = qAbs(rx);
    ry = qAbs(ry);
}}}
at around #1285 in svghandler.cpp to
{{{
    rx = qAbs(rx);
    ry = qAbs(ry);
    if (rx == 0 || ry == 0)
        return; 
}}}

I didn't commit this fix though. This code is in the Qt code base for so long that it would definitely be fixed if it made problems on other platforms (it's very easy to create an invalid .svg to cause zero arguments to be passed in there). But it is still not fixed (see http://qt.gitorious.org/qt/qt/blobs/master/src/svg/qsvghandler.cpp) which means that for some reason it doesn't make any problems anywhere except OS/2. 

"	defect	closed	blocker	Qt GA	General	4.5.1 Beta 3	medium	fixed		
