summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-03-14 08:58:24 -0700
committernicolasroard <nicolasroard@google.com>2013-03-14 08:58:24 -0700
commit1398c04d264d340f136100f0d2af3e675358fb9d (patch)
tree83538558ab1c3eefd6e95460ae6506aa873d6ced
parent278fb4714d77bc0f9fe64a774b3a59561d51ad68 (diff)
downloadandroid_packages_apps_Snap-1398c04d264d340f136100f0d2af3e675358fb9d.zip
android_packages_apps_Snap-1398c04d264d340f136100f0d2af3e675358fb9d.tar.gz
android_packages_apps_Snap-1398c04d264d340f136100f0d2af3e675358fb9d.tar.bz2
Fix for crash upon saving image
Change-Id: I305626a61a07d2290e7d5600da4c26f2a82ab1c9
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java2
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifTag.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
index 6ea6554..e5a5bf0 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
@@ -404,7 +404,7 @@ class ExifOutputStream extends FilterOutputStream {
ifd1.removeTag(ExifInterface.getTrueTagKey(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT));
ifd1.removeTag(ExifInterface
.getTrueTagKey(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH));
- } else {
+ } else if (ifd1 != null) {
// Get rid of offset and length tags if there is no thumbnail.
ifd1.removeTag(ExifInterface.getTrueTagKey(ExifInterface.TAG_STRIP_OFFSETS));
ifd1.removeTag(ExifInterface.getTrueTagKey(ExifInterface.TAG_STRIP_BYTE_COUNTS));
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java b/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
index 0b31c4d..24e7f53 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
@@ -248,7 +248,9 @@ public class ExifTag {
}
long[] data = new long[value.length];
- System.arraycopy(value, 0, data, 0, value.length);
+ for (int i = 0; i < value.length; i++) {
+ data[i] = value[i];
+ }
mValue = data;
mComponentCountActual = value.length;
return true;