Move test case to StagefrightTest
so it is tested with MediaExtractor as well.
Bug: 19779574
Bug: 31156921
Change-Id: I08fbd8e28d23bafea816ea853382a11325c10b7e
diff --git a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
index 71deb67..9e798db 100644
--- a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
@@ -104,10 +104,6 @@
}
}
- public void testonInputBufferFilledSigsegv() throws Exception {
- testIfMediaServerDied(R.raw.on_input_buffer_filled_sigsegv);
- }
-
public void testFlacHeapOverflow() throws Exception {
testIfMediaServerDied(R.raw.heap_oob_flac);
}
diff --git a/tests/tests/media/res/raw/on_input_buffer_filled_sigsegv.mp4 b/tests/tests/security/res/raw/bug_19779574.mp4
similarity index 100%
rename from tests/tests/media/res/raw/on_input_buffer_filled_sigsegv.mp4
rename to tests/tests/security/res/raw/bug_19779574.mp4
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/StagefrightTest.java b/tests/tests/security/src/android/security/cts/StagefrightTest.java
index 2c3a2e7..79d1a84 100644
--- a/tests/tests/security/src/android/security/cts/StagefrightTest.java
+++ b/tests/tests/security/src/android/security/cts/StagefrightTest.java
@@ -354,6 +354,10 @@
doStagefrightTest(R.raw.bug_27855419);
}
+ public void testStagefright_bug_19779574() throws Exception {
+ doStagefrightTest(R.raw.bug_19779574);
+ }
+
/***********************************************************
to prevent merge conflicts, add N tests below this comment,
before any existing test methods
@@ -653,6 +657,7 @@
MediaCodecInfo.CodecCapabilities caps = info.getCapabilitiesForType(mime);
if (caps != null) {
matchingCodecs.add(info.getName());
+ Log.i(TAG, "Found matching codec " + info.getName() + " for track " + t);
}
} catch (IllegalArgumentException e) {
// type is not supported
@@ -663,7 +668,12 @@
Log.w(TAG, "no codecs for track " + t + ", type " + mime);
}
// decode this track once with each matching codec
- ex.selectTrack(t);
+ try {
+ ex.selectTrack(t);
+ } catch (IllegalArgumentException e) {
+ Log.w(TAG, "couldn't select track " + t);
+ // continue on with codec initialization anyway, since that might still crash
+ }
for (String codecName: matchingCodecs) {
Log.i(TAG, "Decoding track " + t + " using codec " + codecName);
ex.seekTo(0, MediaExtractor.SEEK_TO_CLOSEST_SYNC);