Mir

Invalid reference in compositor.cpp

Bug #1152628 reported by Jussi Pakkanen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alan Griffiths

Bug Description

Discovered by Clang.

compositor.cpp has the following piece of code.

struct FilterForVisibleRenderablesInRegion : public mc::FilterForRenderables
{
    FilterForVisibleRenderablesInRegion(mir::geometry::Rectangle enclosing_region)
        : enclosing_region(enclosing_region)
    {
    }
    bool operator()(mg::Renderable& renderable)
    {
        return !renderable.hidden();
    }
    mir::geometry::Rectangle &enclosing_region;
};

The struct member is a reference, but it is initialised to a constructor argument that is passed by value. When the constructor finishes the argument is destroyed and the reference becomes invalid.

Related branches

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Luckily the invalid member isn't used.

Changed in mir:
status: New → Confirmed
assignee: nobody → Alan Griffiths (alan-griffiths)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.0.2

Changed in mir:
status: Confirmed → Fix Committed
Changed in mir:
importance: Undecided → High
Changed in mir:
milestone: none → 0.0.3
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.