summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <hennymcc@yahoo.de>2015-07-19 12:15:38 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-11-02 09:23:04 (GMT)
commitf6a8d4f481fb17c271d84415761fb0e08794d8a2 (patch)
tree5088622d39df0efa4e89c456c51714faba4c958d
parent88dc0de52961f2337b9c308a5506acfa50940722 (diff)
downloadandroid_packages_apps_Trebuchet-f6a8d4f481fb17c271d84415761fb0e08794d8a2.zip
android_packages_apps_Trebuchet-f6a8d4f481fb17c271d84415761fb0e08794d8a2.tar.gz
android_packages_apps_Trebuchet-f6a8d4f481fb17c271d84415761fb0e08794d8a2.tar.bz2
Fix crash if Exif-Tag buffer-length and component-count are both 0
Change-Id: Iad9b60d135b4f682c08c3bfc9698cdd10e1086ab
-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 {