summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Xie <dxie@google.com>2016-06-20 17:26:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-06-20 17:26:25 +0000
commite50ec09f51e78383314d31699702fa9680575014 (patch)
tree102289ba4dd1b90a8a70e4ae2564f520fd529e20
parentdd8ee3dca08de53e066b4ed1dfb4f921158135ba (diff)
parent10a27e9830a750e8bf90164c24696f2f7b1333f1 (diff)
downloadcts-e50ec09f51e78383314d31699702fa9680575014.tar.gz
Merge "DO NOT MERGE: CTS test case for verifying overflow in libskia JPG processing" into kitkat-cts-dev
-rw-r--r--tests/res/drawable/signal_sigsegv_in_jmem_ashmem.jpgbin0 -> 4722 bytes
-rw-r--r--tests/tests/security/src/android/security/cts/SkiaJpegDecodingTest.java51
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/res/drawable/signal_sigsegv_in_jmem_ashmem.jpg b/tests/res/drawable/signal_sigsegv_in_jmem_ashmem.jpg
new file mode 100644
index 00000000000..f63f6ef348a
--- /dev/null
+++ b/tests/res/drawable/signal_sigsegv_in_jmem_ashmem.jpg
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/SkiaJpegDecodingTest.java b/tests/tests/security/src/android/security/cts/SkiaJpegDecodingTest.java
new file mode 100644
index 00000000000..833dc629ff0
--- /dev/null
+++ b/tests/tests/security/src/android/security/cts/SkiaJpegDecodingTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.app.Activity;
+import android.test.ActivityInstrumentationTestCase;
+import android.widget.ImageView;
+import android.widget.cts.ImageViewStubActivity;
+
+import com.android.cts.stub.R;
+
+public class SkiaJpegDecodingTest extends ActivityInstrumentationTestCase<ImageViewStubActivity> {
+ private Activity mActivity;
+
+ public SkiaJpegDecodingTest() {
+ super("com.android.cts.stub", ImageViewStubActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mActivity = getActivity();
+ }
+
+ public void testLibskiaOverFlowJpegProcessing() {
+ ImageView mImageView = new ImageView(mActivity);
+ mImageView.setImageResource(R.drawable.signal_sigsegv_in_jmem_ashmem);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (mActivity != null) {
+ mActivity.finish();
+ }
+ super.tearDown();
+ }
+}