Bug 103412 - gallium/wgl: Another fix to context creation without prior SetPixelFormat()
Summary: gallium/wgl: Another fix to context creation without prior SetPixelFormat()
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 17.2
Hardware: Other Windows (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-23 09:49 UTC by frank.richter
Modified: 2017-11-15 23:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch: Don't blindly use GetPixelFormat() return value (2.23 KB, patch)
2017-10-23 09:49 UTC, frank.richter
Details | Splinter Review

Description frank.richter 2017-10-23 09:49:44 UTC
Created attachment 135000 [details] [review]
patch: Don't blindly use GetPixelFormat() return value

This is a follow-up to bug 101326.

The patch for that bug blindly took the pixel format index returned by GetPixelFormat(). However, what's the guarantee that this pixel format index is actually sensible in the Mesa context, or even a valid index?

Well, none actually. (It's also not an entirely theoretic problem. I received a crash report where an invalid index is indicated, though I couldn't reproduce the exact scenario.)

The attached patch fixes the blind usage of the index by computing the proper Mesa pixel format index from the pixel format description.
Comment 1 Brian Paul 2017-11-10 19:06:52 UTC
Thanks.  Looks good AFAICT.  I'll do a little reformatting and testing before pushing.
Comment 2 Brian Paul 2017-11-15 23:27:41 UTC
Pushed as commit bf41b2b2627aa3790d380092c28c5d3395cc9cde


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.