Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbd4b841 authored by Namit Solanki's avatar Namit Solanki Committed by Linux Build Service Account
Browse files

surfaceflinger: Validate LayerListIterator before accessing it.

- Check LayerListIterator for NULL before dereferencing it.

Change-Id: I299ee94ef264280aca991e1e574b998b4b58951e
CRs-Fixed: 1039837
parent efa53669
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -242,6 +242,9 @@ public:
        bool operator != (const LayerListIterator& rhs) const {
            return !operator==(rhs);
        }
        bool operator ! () const {
             return !mLayerList;
        }
    };

    // Returns an iterator to the beginning of the layer list
+2 −0
Original line number Diff line number Diff line
@@ -235,6 +235,8 @@ void ExSurfaceFlinger::setOrientationEventControl(bool& freezeSurfacePresent,
                             const int32_t& id) {
    HWComposer& hwc(getHwComposer());
    HWComposer::LayerListIterator cur = hwc.begin(id);
    if(!cur)
        return;

    if(freezeSurfacePresent) {
        /* If freezeSurfacePresent, set ANIMATING flag