wxDCImpl::ComputeScaleAndOrigin();
- // If scale has changed call SetPen to recalulate the line width
+ // If scale has changed call SetPen to recalculate the line width
// and SetFont to recalculate font size
if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.IsOk() )
{
long sum=0;
float height=fontSize; /* by default */
- unsigned char *p;
- for(p=(unsigned char *)wxMBSTRINGCAST strbuf; *p; p++)
+ unsigned char *p=(unsigned char *)wxMBSTRINGCAST strbuf;
+ if(!p)
+ {
+ // String couldn't be converted which used to SEGV as reported here:
+ // http://bugs.debian.org/702378
+ // http://trac.wxwidgets.org/ticket/15300
+ // Upstream suggests "just return if the conversion failed".
+ if (x) (*x) = 0;
+ if (y) (*y) = 0;
+ if (descent) (*descent) = 0;
+ if (externalLeading) (*externalLeading) = 0;
+ return;
+ }
+ for(; *p; p++)
{
if(lastWidths[*p]== INT_MIN)
{