<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Exporting xls/rhbz499466-2.xls to PDF triggers undefined conversion from NaN to int"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=125924">125924</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Exporting xls/rhbz499466-2.xls to PDF triggers undefined conversion from NaN to int
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Chart
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sbergman@redhat.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>quikee@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>(With <<a href="https://gerrit.libreoffice.org/#/c/74055/">https://gerrit.libreoffice.org/#/c/74055/</a>> "Avoid
-fsanitize=float-divide-by-zero" out of the way:)  At least on recent master,
`--convert-to pdf xls/rhbz499466-2.xls` with xls/rhbz499466-2.xls as obtained
by bin/get-bugzilla-attachments-by-mimetype (i.e., the attachment at
<<a href="https://bugzilla.redhat.com/show_bug.cgi?id=499466#c1">https://bugzilla.redhat.com/show_bug.cgi?id=499466#c1</a>>):

<span class="quote">> chart2/source/view/charttypes/VSeriesPlotter.cxx:1342:33: runtime error: nan is outside the range of representable values of type 'int'
>  #0 in chart::VSeriesPlotter::createRegressionCurvesShapes(chart::VDataSeries const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool) at chart2/source/view/charttypes/VSeriesPlotter.cxx:1342:33
>  #1 in chart::AreaChart::impl_createSeriesShapes() at chart2/source/view/charttypes/AreaChart.cxx:539:17 (instdir/program/../program/libchartcorelo.so +0x2428578)
>  #2 in chart::AreaChart::createShapes() at chart2/source/view/charttypes/AreaChart.cxx:965:5
>  #3 in chart::ChartView::impl_createDiagramAndContent(chart::CreateShapeParam2D const&, com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:1608:25
>  #4 in chart::ChartView::createShapes2D(com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:3037:41
>  #5 in chart::ChartView::createShapes() at chart2/source/view/main/ChartView.cxx:2506:5</span >
[...]

The problem is that in

<span class="quote">>         if( !bAverageLine )
>         {
>             rVDataSeries.getMinMaxXValue(fMinX, fMaxX);
>             fMaxX += aExtrapolateForward;
>             fMinX -= aExtrapolateBackward;

>             fPointScale = (fMaxX - fMinX) / (fChartMaxX - fChartMinX);
>             fPointScale = std::min(fPointScale, 1000.0);
>         }</span >

(VSeriesPlotter::createRegressionCurvesShapes,
chart2/source/view/charttypes/VSeriesPlotter.cxx) the call to
VDataSeries::getMinMaxXValue sets fMinX and fMaxX to NaN, so fPointScale is set
to NaN, and the later

<span class="quote">>         sal_Int32 nPointCount = 100 * fPointScale;</span >

causes undefined behavior.  That code got updated, if not introduced with
<<a href="https://gerrit.libreoffice.org/plugins/gitiles/core/+/9408a1d008487cbeafd2dc4705eda2fae9547aab%5E">https://gerrit.libreoffice.org/plugins/gitiles/core/+/9408a1d008487cbeafd2dc4705eda2fae9547aab%5E</a>!>
"Draw MeanValue in chart bounds, smarter define no. of curve points."</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>