Opened 11 years ago
Closed 11 years ago
Last modified 11 years ago
#11660 closed Patch - Bug Fix (fixed)
Patch to initialize Initialize member variables in MythRenderOpenGL ctor - fixes Coverity 700926 and 700927
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 0.27 |
Component: | MythTV - User Interface Library | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Static analysis detected that the member variables were not being initialized in the MythRenderOpenGL ctor.
In actuality, after the OpenGL re-factor, the code appears to result in the ResetVars? and ResetProcs? functions being called from the ctors of MythRenderOpenGL[12], but invoke them explicitly in the ctor to keep Coverity happy.
Fixes Coverity 700926 and 700927
github ref: https://github.com/garybuhrmaster/mythtv/commit/99e0e577d7f5aa789fbeabffae8b989a61a72288
github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/99e0e577d7f5aa789fbeabffae8b989a61a72288.patch
Change History (6)
comment:2 follow-up: 3 Changed 11 years ago by
Replying to natanojl:
This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).
Good catch. Thanks. I had seen the "new" a month or so ago when I first reviewed a possible fix, and then completely forgot about it (and missed it) in this second pass. I'll try to get a revised patch worked out when I have some time this weekend. In case it takes me some time to get around to it, you should feel free to close this ticket (as "broken"/"wontfix") and I'll submit a new ticket with a new patch.
comment:3 Changed 11 years ago by
Replying to Gary Buhrmaster <gary.buhrmaster@…>:
Replying to natanojl:
This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).
Good catch. Thanks. I had seen the "new" a month or so ago when I first reviewed a possible fix, and then completely forgot about it (and missed it) in this second pass. I'll try to get a revised patch worked out when I have some time this weekend. In case it takes me some time to get around to it, you should feel free to close this ticket (as "broken"/"wontfix") and I'll submit a new ticket with a new patch.
Here is an additional patch (apply at the same time, or it can be applied first) that is a "minimal" fix that eliminates the use of the pointer and uses the initialization list (I can find no reason that was not done originally; I may have simply missed the history). A quick look suggests that most of the member variables should move to the initialization list (and would be a better long term fix). But that is a much bigger change, and then there is the longer term re-factor for all this code that would make it all moot anyway.
github ref: https://github.com/garybuhrmaster/mythtv/commit/ff042bddaf85a25f0faa019d081f1dd8921ed68d github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/ff042bddaf85a25f0faa019d081f1dd8921ed68d.patch
comment:4 Changed 11 years ago by
Owner: | set to Gary Buhrmaster <gary.buhrmaster@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:6 Changed 11 years ago by
Milestone: | unknown → 0.27 |
---|
This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).