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

Commit 8fad5d86 authored by Steven Moreland's avatar Steven Moreland Committed by Android (Google) Code Review
Browse files

Merge "libhwui: AnimatedImageThread - UAF" into sc-dev

parents 390dbd72 61c3fcf7
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -22,13 +22,16 @@ namespace android {
namespace uirenderer {

AnimatedImageThread& AnimatedImageThread::getInstance() {
    static AnimatedImageThread* sInstance = new AnimatedImageThread();
    return *sInstance;
    [[clang::no_destroy]] static sp<AnimatedImageThread> sInstance = []() {
        sp<AnimatedImageThread> thread = sp<AnimatedImageThread>::make();
        thread->start("AnimatedImageThread");
        return thread;
    }();
    return *sInstance.get();
}

AnimatedImageThread::AnimatedImageThread() {
    setpriority(PRIO_PROCESS, 0, PRIORITY_NORMAL + PRIORITY_MORE_FAVORABLE);
    start("AnimatedImageThread");
}

std::future<AnimatedImageDrawable::Snapshot> AnimatedImageThread::decodeNextFrame(
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public:
    std::future<AnimatedImageDrawable::Snapshot> reset(const sk_sp<AnimatedImageDrawable>&);

private:
    friend sp<AnimatedImageThread>;
    AnimatedImageThread();
};