summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-08-08 15:19:13 +0800
committerEarl Ou <shunhsingou@google.com>2012-08-08 15:19:13 +0800
commit0d64f476c62215c7738655f62b89f93ac60c7fe2 (patch)
tree7bcc32887b8e73ede7a484dd8601c9707637e457 /tests
parentab3625ea8cab1cc338578090feefeb642f109eca (diff)
downloadandroid_packages_apps_Snap-0d64f476c62215c7738655f62b89f93ac60c7fe2.zip
android_packages_apps_Snap-0d64f476c62215c7738655f62b89f93ac60c7fe2.tar.gz
android_packages_apps_Snap-0d64f476c62215c7738655f62b89f93ac60c7fe2.tar.bz2
Handle error when string length=0 in IfdParser
Change-Id: I3a51e85060f3acd5026555e5f8d21f8cb2e0641e
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifParserTest.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java
index 34bbbda..35f4f3f 100644
--- a/tests/src/com/android/gallery3d/exif/ExifParserTest.java
+++ b/tests/src/com/android/gallery3d/exif/ExifParserTest.java
@@ -283,12 +283,8 @@ public class ExifParserTest extends InstrumentationTestCase {
}
break;
case ExifTag.TYPE_ASCII:
- buf = new byte[tag.getComponentCount()];
- parser.read(buf);
- int length = 0;
- while (buf[length] != 0 && length < buf.length) length++;
- // trim the string to fit the answer from xml
- sbuilder.append(new String(buf, 0, length).trim());
+ // trim the string for comparison between xml
+ sbuilder.append(parser.readString(tag.getComponentCount()).trim());
break;
case ExifTag.TYPE_INT:
for(int i = 0; i < tag.getComponentCount(); i++) {