DNG: Fix row stride check.
Bug: 16986715
Change-Id: I5337194f7078d394b9e972e81861794283925612
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index eaadfb2..a728455 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -428,7 +428,7 @@
status_t InputStripSource::writeToStream(Output& stream, uint32_t count) {
status_t err = OK;
- uint32_t fullSize = mRowStride * mHeight;
+ uint32_t fullSize = mWidth * mHeight * mBytesPerSample * mSamplesPerPixel;
jlong offset = mOffset;
if (fullSize != count) {
@@ -560,7 +560,7 @@
DirectStripSource::~DirectStripSource() {}
status_t DirectStripSource::writeToStream(Output& stream, uint32_t count) {
- uint32_t fullSize = mRowStride * mHeight;
+ uint32_t fullSize = mWidth * mHeight * mBytesPerSample * mSamplesPerPixel;
if (fullSize != count) {
ALOGE("%s: Amount to write %u doesn't match image size %u", __FUNCTION__, count,