summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java b/WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java
index 7ca05f2..4c2009f 100644
--- a/WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java
+++ b/WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java
@@ -482,7 +482,7 @@ class ExifOutputStream extends FilterOutputStream {
switch (tag.getDataType()) {
case ExifTag.TYPE_ASCII:
byte buf[] = tag.getStringByte();
- if (buf.length == tag.getComponentCount()) {
+ if (buf.length == tag.getComponentCount() && buf.length > 0) {
buf[buf.length - 1] = 0;
dataOutputStream.write(buf);
} else {