[RESTRICT AUTOMERGE] Updated CTS test for b/23247055

Bug: 23247055
Bug: 135640247
Test: Ran the new testcase on android-8.0.0_r2 to test with/without patch

Change-Id: I38dbb6c090d92dc0082ec4cd91361607186007a9
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.mk
index 7977fe6..3769db6 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.mk
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/Android.mk
@@ -20,7 +20,7 @@
 LOCAL_MULTILIB := both
 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_C_INCLUDES := frameworks/av/media/libstagefright
+LOCAL_C_INCLUDES := frameworks/av/include/media/stagefright
 LOCAL_SHARED_LIBRARIES := libstagefright
 LOCAL_SHARED_LIBRARIES += libutils
 LOCAL_SHARED_LIBRARIES += libmedia
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/poc.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/poc.cpp
index c02bc4d..724abb3 100644
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/poc.cpp
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2015-3873/poc.cpp
@@ -13,11 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <media/stagefright/FileSource.h>
-#include <media/stagefright/MediaExtractor.h>
-#include <media/stagefright/MediaSource.h>
-#include <media/stagefright/MetaData.h>
-#include "include/MPEG4Extractor.h"
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <MediaExtractor.h>
+#include <MediaSource.h>
+#include <MetaData.h>
+#include <MediaDefs.h>
 #define CONVERSION_FACTOR_SEC_TO_MICROSEC 1000000
 
 using namespace android;
@@ -26,12 +27,25 @@
     if(argc < 2) {
         return EXIT_FAILURE;
     }
-    const sp<DataSource> dataSource = new FileSource(argv[1]);
-    MediaExtractor *mp4Extractor = new MPEG4Extractor(dataSource.get());
 
-    if(!mp4Extractor) {
+    int32_t fd = open(argv[1], O_RDONLY);
+    if(fd < 0) {
         return EXIT_FAILURE;
     }
+
+    int64_t fileSize = lseek(fd, 0, SEEK_END);
+    lseek(fd, 0, SEEK_SET);
+    sp<DataSource> dataSource = DataSource::CreateFromFd(fd, 0, fileSize);
+    if (dataSource == nullptr) {
+        return EXIT_FAILURE;
+    }
+
+    sp<IMediaExtractor> mp4Extractor =
+            MediaExtractor::CreateFromService(dataSource, MEDIA_MIMETYPE_CONTAINER_MPEG4);
+    if(mp4Extractor == nullptr) {
+        return EXIT_FAILURE;
+    }
+
     //seek to 10 seconds in the mp4 file
     int64_t seekTimeUs = 10 * CONVERSION_FACTOR_SEC_TO_MICROSEC;
     size_t numTracks = mp4Extractor->countTracks();