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

Commit 37fd8f63 authored by Robert Shih's avatar Robert Shih Committed by android-build-team Robot
Browse files

httplive: detect oom if playlist is infinite

Bug: 68399439
Test: StagefrightTest#testStagefright_cve_2017_13279
Change-Id: Icf39c2ae58d9d6ba7c74bbcfbe2154e66e6c9e40
(cherry picked from commit f3808d3a)
parent 9fc7bf5d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -157,6 +157,12 @@ ssize_t HTTPDownloader::fetchBlock(
                 buffer->size() + bufferRemaining);

            sp<ABuffer> copy = new ABuffer(buffer->size() + bufferRemaining);
            if (copy->data() == NULL) {
                android_errorWriteLog(0x534e4554, "68399439");
                ALOGE("not enough memory to download: requesting %zu + %zu",
                        buffer->size(), bufferRemaining);
                return NO_MEMORY;
            }
            memcpy(copy->data(), buffer->data(), buffer->size());
            copy->setRange(0, buffer->size());