libjpegrecoverymap: bug fix
nameSpaceLength is already +1ed
Test: recoverymap_test
Change-Id: I73a11108bb8f1b2474a518bcbf8460f7e4a672db
diff --git a/libs/jpegrecoverymap/recoverymap.cpp b/libs/jpegrecoverymap/recoverymap.cpp
index 53fa8ce..bc69a83 100644
--- a/libs/jpegrecoverymap/recoverymap.cpp
+++ b/libs/jpegrecoverymap/recoverymap.cpp
@@ -864,7 +864,7 @@
// 2 bytes: representing the length of the package
// 29 bytes: length of name space "http://ns.adobe.com/xap/1.0/\0",
// x bytes: length of xmp packet
- const int length = 3 + nameSpaceLength + xmp.size();
+ const int length = 2 + nameSpaceLength + xmp.size();
const uint8_t lengthH = ((length >> 8) & 0xff);
const uint8_t lengthL = (length & 0xff);
JPEGR_CHECK(Write(dest, &photos_editing_formats::image_io::JpegMarker::kStart, 1, pos));