Bug 80889

Summary: draw_pipe_clip.c division by zero in interp
Product: Mesa Reporter: Vittorio <zeccav>
Component: OtherAssignee: mesa-dev
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: medium    
Version: 10.2   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.