# HG changeset patch # User Rik # Date 1382467813 25200 # Node ID d449f4668b721f595d321de0626bf6cb8ce0010a # Parent 3f02bcf2bdcc50a26b61cc528dcfe59c39246148 Print warning and abort plot if data range > max float (bug #40246) * libinterp/corefcn/gl-render.cc(draw_axes): check x, y, and z max values are smaller than std::numeric_limits::max. If not, issue warning and abort plotting. diff --git a/libinterp/corefcn/gl-render.cc b/libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -1392,6 +1392,8 @@ void opengl_renderer::draw_axes (const axes::properties& props) { + static double floatmax = std::numeric_limits::max (); + double x_min = props.get_x_min (); double x_max = props.get_x_max (); double y_min = props.get_y_min (); @@ -1399,6 +1401,12 @@ double z_min = props.get_z_min (); double z_max = props.get_z_max (); + if (x_max > floatmax || y_max > floatmax || z_max > floatmax) + { + warning ("gl-render: data limits greater than float capacity"); + return; + } + setup_opengl_transformation (props); // draw axes object