• kylechar's avatar
    Avoid crashing on empty RenderPassList. · 5b224537
    kylechar authored
    SurfaceAggregator::Aggregate() could attempt to use the last entry in
    |dest_pass_list_| without verifying there was anything in it and crash.
    There is an early exit for an empty list, but it's after the code uses
    the last entry in the list.
    
    The way that member variables are used during Aggregate() is a bit
    awkward, many of them are used only for the duration of Aggregate() to
    avoid passing variables around and need to be reset, while others need
    to persist after Aggregate(). While it would be best if the temporary
    state needed during Aggregate() was refactored out, this CL adds a
    member function to reset variables needed only during Aggregate(). This
    allows moving the early exit before using |dest_pass_list_|.
    
    Bug: 1126897
    Change-Id: Ie6979a637ba1f3f301394171ca74064fccc5c4f0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404473Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
    Commit-Queue: kylechar <kylechar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#806322}
    5b224537
surface_aggregator.h 20 KB