From 316c3d929ffb004b0150d515e82aede02208ce97 Mon Sep 17 00:00:00 2001 From: Wonsik Kim Date: Tue, 8 Sep 2015 17:32:28 +0900 Subject: NuCachedSource2: fix possible erroneous early free Because the constructor of NuCachedSource2 sent a message to AHandlerReflector object, AHandlerReflector::onMessageReceived could have executed just before the object gets wrapped in a strong pointer, resulting in erroneous early free. Fix the issue by using static Create function to ensure the message is sent after the object is wrapped in a sp. Bug: 23882800 Change-Id: I38a9d7a3083f184b4c81d0b00ba1661721278855 --- media/libstagefright/DataSource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'media/libstagefright/DataSource.cpp') diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp index 75ef288..5020c6c 100644 --- a/media/libstagefright/DataSource.cpp +++ b/media/libstagefright/DataSource.cpp @@ -246,7 +246,7 @@ sp DataSource::CreateFromURI( *contentType = httpSource->getMIMEType(); } - source = new NuCachedSource2( + source = NuCachedSource2::Create( httpSource, cacheConfig.isEmpty() ? NULL : cacheConfig.string(), disconnectAtHighwatermark); -- cgit v1.1