diff options
Diffstat (limited to 'src/com/android/gallery3d/exif/IfdParser.java')
-rw-r--r-- | src/com/android/gallery3d/exif/IfdParser.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/exif/IfdParser.java b/src/com/android/gallery3d/exif/IfdParser.java index b0b0bce10..0d1059cb0 100644 --- a/src/com/android/gallery3d/exif/IfdParser.java +++ b/src/com/android/gallery3d/exif/IfdParser.java @@ -125,9 +125,13 @@ public class IfdParser { } public String readString(int n) throws IOException { - byte[] buf = new byte[n]; - mTiffStream.readOrThrow(buf); - return new String(buf, 0, n - 1, "UTF8"); + if (n > 0) { + byte[] buf = new byte[n]; + mTiffStream.readOrThrow(buf); + return new String(buf, 0, n - 1, "UTF8"); + } else { + return ""; + } } public String readString(int n, Charset charset) throws IOException { |