Bug 80889 - draw_pipe_clip.c division by zero in interp
Summary: draw_pipe_clip.c division by zero in interp
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 10.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-04 05:54 UTC by Vittorio
Modified: 2014-07-04 06:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vittorio 2014-07-04 05:54:55 UTC
In draw_pipe_clip.c:166
"const float oow = 1.0f / pos[3];"
I found that running a geant4 example pos[3] is zero.
Unfortunately I do not remember which example ran.
I believe an "assert(pos[3]);" or equivalent should be put immediately before
to avoid a division by zero.
Comment 1 Roland Scheidegger 2014-07-04 06:24:54 UTC
Division by zero is just fine with floats, the code should be able to deal with the resulting infs (or perhaps nans in some places), if not this would be a bug. Since these values are out of our control (as they might come directly from user supplied shader) there is nothing which we could do to prevent those from happening.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.