diff --git a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
index d258f80..10a9db8 100644
--- a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
+++ b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h
@@ -54,8 +54,10 @@
 struct jpegr_compressed_struct {
     // Pointer to the data location.
     void* data;
-    // Data length.
+    // Used data length in bytes.
     int length;
+    // Maximum available data length in bytes.
+    int maxLength;
     // Color gamut.
     jpegr_color_gamut colorGamut;
 };
diff --git a/libs/jpegrecoverymap/recoverymap.cpp b/libs/jpegrecoverymap/recoverymap.cpp
index 64021b7..ad41839 100644
--- a/libs/jpegrecoverymap/recoverymap.cpp
+++ b/libs/jpegrecoverymap/recoverymap.cpp
@@ -43,6 +43,8 @@
 
 // Map is quarter res / sixteenth size
 static const size_t kMapDimensionScaleFactor = 4;
+// JPEG compress quality (0 ~ 100) for recovery map
+static const int kMapCompressQuality = 85;
 
 // TODO: fill in st2086 metadata
 static const st2086_metadata kSt2086Metadata = {
@@ -77,7 +79,7 @@
  * @return status of succeed or error code.
  */
 status_t Write(jr_compressed_ptr destination, const void* source, size_t length, int &position) {
-  if (position + length > destination->length) {
+  if (position + length > destination->maxLength) {
     return ERROR_JPEGR_BUFFER_TOO_SMALL;
   }
 
@@ -121,8 +123,8 @@
   map_data.reset(reinterpret_cast<uint8_t*>(map.data));
 
   jpegr_compressed_struct compressed_map;
-  std::unique_ptr<uint8_t[]> compressed_map_data =
-      std::make_unique<uint8_t[]>(map.width * map.height);
+  compressed_map.maxLength = map.width * map.height;
+  unique_ptr<uint8_t[]> compressed_map_data = make_unique<uint8_t[]>(compressed_map.maxLength);
   compressed_map.data = compressed_map_data.get();
   JPEGR_CHECK(compressRecoveryMap(&map, &compressed_map));
 
@@ -173,8 +175,8 @@
   map_data.reset(reinterpret_cast<uint8_t*>(map.data));
 
   jpegr_compressed_struct compressed_map;
-  std::unique_ptr<uint8_t[]> compressed_map_data =
-      std::make_unique<uint8_t[]>(map.width * map.height);
+  compressed_map.maxLength = map.width * map.height;
+  unique_ptr<uint8_t[]> compressed_map_data = make_unique<uint8_t[]>(compressed_map.maxLength);
   compressed_map.data = compressed_map_data.get();
   JPEGR_CHECK(compressRecoveryMap(&map, &compressed_map));
 
@@ -222,8 +224,8 @@
   map_data.reset(reinterpret_cast<uint8_t*>(map.data));
 
   jpegr_compressed_struct compressed_map;
-  std::unique_ptr<uint8_t[]> compressed_map_data =
-      std::make_unique<uint8_t[]>(map.width * map.height);
+  compressed_map.maxLength = map.width * map.height;
+  unique_ptr<uint8_t[]> compressed_map_data = make_unique<uint8_t[]>(compressed_map.maxLength);
   compressed_map.data = compressed_map_data.get();
   JPEGR_CHECK(compressRecoveryMap(&map, &compressed_map));
 
@@ -289,13 +291,17 @@
 
   // TODO: should we have ICC data for the map?
   JpegEncoder jpeg_encoder;
-  if (!jpeg_encoder.compressImage(uncompressed_recovery_map->data, uncompressed_recovery_map->width,
-                                  uncompressed_recovery_map->height, 85, nullptr, 0,
+  if (!jpeg_encoder.compressImage(uncompressed_recovery_map->data,
+                                  uncompressed_recovery_map->width,
+                                  uncompressed_recovery_map->height,
+                                  kMapCompressQuality,
+                                  nullptr,
+                                  0,
                                   true /* isSingleChannel */)) {
     return ERROR_JPEGR_ENCODE_ERROR;
   }
 
-  if (dest->length < jpeg_encoder.getCompressedImageSize()) {
+  if (dest->maxLength < jpeg_encoder.getCompressedImageSize()) {
     return ERROR_JPEGR_BUFFER_TOO_SMALL;
   }
 
