summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortobigun <hennymcc@yahoo.de>2015-07-19 14:15:38 +0200
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-10 08:43:38 -0800
commit54a9c2a494ee1440f3f063207cbc82811a70d0ce (patch)
tree90d684a8807777da8edb19f68b34b160e044569b /src
parent2160a59f67d3a9543e1234b50b2255c635d1a721 (diff)
downloadandroid_packages_apps_Snap-54a9c2a494ee1440f3f063207cbc82811a70d0ce.zip
android_packages_apps_Snap-54a9c2a494ee1440f3f063207cbc82811a70d0ce.tar.gz
android_packages_apps_Snap-54a9c2a494ee1440f3f063207cbc82811a70d0ce.tar.bz2
Fix crash if Exif-Tag buffer-length and component-count are both 0
Change-Id: Iad9b60d135b4f682c08c3bfc9698cdd10e1086ab
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/exif/ExifOutputStream.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/camera/exif/ExifOutputStream.java b/src/com/android/camera/exif/ExifOutputStream.java
index 90d4327..47b95d8 100644
--- a/src/com/android/camera/exif/ExifOutputStream.java
+++ b/src/com/android/camera/exif/ExifOutputStream.java
@@ -491,7 +491,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 {