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

Commit c695f0f1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "MediaCodec: fix an overflow error" into main

parents 93c09baf 5d59fe12
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1248,6 +1248,11 @@ status_t MediaCodec::getGloballyAvailableResources(std::vector<GlobalResourceInf
                                         return item.type == type; });

            if (used != currentResourceUsage.end() && used->value > 0) {
                if (res.mAvailable < used->value) {
                    ALOGW("%s: Resources used (%jd) is more than the Resource Capacity (%jd)!",
                          __func__, used->value, res.mAvailable);
                    continue;
                }
                // Exclude the used resources.
                res.mAvailable -= used->value;
            }