diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index d6eeb962e81d..e7f66d66698c 100644
--- a/src/android/jpeg/post_processor_jpeg.cpp
+++ b/src/android/jpeg/post_processor_jpeg.cpp
@@ -185,9 +185,17 @@ int PostProcessorJpeg::process(const FrameBuffer &source,
 	}
 
 	/* Fill in the JPEG blob header. */
-	uint8_t *resultPtr = destination->plane(0) +
-			     destination->planeSize(0) -
-			     sizeof(struct camera3_jpeg_blob);
+	/*
+	 * \todo For backward compatibility reasons with the android_generic
+	 * memory backend, continue using the maxJpegBufferSize in case the
+	 * computed buffer size is larger. This can be dropped once all
+	 * supported platforms will have a working memory backend that
+	 * returns the correct buffer size.
+	 */
+	size_t blobSize = std::min<unsigned int>(cameraDevice_->maxJpegBufferSize(),
+						 destination->planeSize(0));
+	uint8_t *resultPtr = destination->plane(0) + blobSize
+			   - sizeof(struct camera3_jpeg_blob);
 	auto *blob = reinterpret_cast<struct camera3_jpeg_blob *>(resultPtr);
 	blob->jpeg_blob_id = CAMERA3_JPEG_BLOB_ID;
 	blob->jpeg_size = jpeg_size;
