summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-04-02 22:19:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-02 22:19:05 +0000
commit7bf0f568f7e09275477f1ff2a4ac107274798329 (patch)
tree28b1c87efebb809a172996a95fa27f1443886a23
parent54762e1e909d7bf85dc913414b047be9a499c18a (diff)
parent14954a62d0d103a5b120225ccf1d7da38b8694e3 (diff)
downloadandroid_packages_apps_Gallery2-7bf0f568f7e09275477f1ff2a4ac107274798329.tar.gz
android_packages_apps_Gallery2-7bf0f568f7e09275477f1ff2a4ac107274798329.tar.bz2
android_packages_apps_Gallery2-7bf0f568f7e09275477f1ff2a4ac107274798329.zip
Merge "Cleanup sloppy memory handling in ExifOutputStream." into gb-ub-photos-bryce
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
index e5a5bf009..38b34fc6c 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifOutputStream.java
@@ -75,6 +75,7 @@ class ExifOutputStream extends FilterOutputStream {
private int mState = STATE_SOI;
private int mByteToSkip;
private int mByteToCopy;
+ private byte[] mSingleByteArray = new byte[1];
private ByteBuffer mBuffer = ByteBuffer.allocate(4);
private final ExifInterface mInterface;
@@ -190,10 +191,8 @@ class ExifOutputStream extends FilterOutputStream {
*/
@Override
public void write(int oneByte) throws IOException {
- byte[] buf = new byte[] {
- (byte) (0xff & oneByte)
- };
- write(buf);
+ mSingleByteArray[0] = (byte) (0xff & oneByte);
+ write(mSingleByteArray);
}
/**