Merge changes from topic "am-b39caaa3-4861-4759-a55f-8e0eb691097b" into nyc-mr2-dev
* changes:
[automerger] httplive: detect oom if playlist is infinite am: f3808d3a2e am: a7a8c35d92 am: f5dcf4dca9 am: 2f3fb2626c
[automerger] httplive: detect oom if playlist is infinite am: f3808d3a2e am: a7a8c35d92 am: f5dcf4dca9
[automerger] httplive: detect oom if playlist is infinite am: f3808d3a2e am: a7a8c35d92
[automerger] httplive: detect oom if playlist is infinite am: f3808d3a2e
httplive: detect oom if playlist is infinite
diff --git a/media/libstagefright/httplive/HTTPDownloader.cpp b/media/libstagefright/httplive/HTTPDownloader.cpp
index 861b85a..5d6634e 100644
--- a/media/libstagefright/httplive/HTTPDownloader.cpp
+++ b/media/libstagefright/httplive/HTTPDownloader.cpp
@@ -157,6 +157,12 @@
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());