summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/exif/ExifInterface.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/exif/ExifInterface.java')
-rw-r--r--src/com/android/camera/exif/ExifInterface.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/exif/ExifInterface.java b/src/com/android/camera/exif/ExifInterface.java
index 0f495f227..3049d2680 100644
--- a/src/com/android/camera/exif/ExifInterface.java
+++ b/src/com/android/camera/exif/ExifInterface.java
@@ -36,6 +36,7 @@ import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel.MapMode;
+import java.nio.MappedByteBuffer;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -1039,11 +1040,12 @@ public class ExifInterface {
}
// Map only exif header into memory.
- ByteBuffer buf = file.getChannel().map(MapMode.READ_WRITE, 0, exifSize);
+ MappedByteBuffer buf = file.getChannel().map(MapMode.READ_WRITE, 0, exifSize);
// Attempt to overwrite tag values without changing lengths (avoids
// file copy).
ret = rewriteExif(buf, tags);
+ buf.force();
} catch (IOException e) {
closeSilently(file);
throw e;