summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2014-08-12 11:09:01 -0700
committerRuben Brunk <rubenbrunk@google.com>2014-08-12 22:54:13 +0000
commit3e1902504979b9b456a14dffa6507ee2d9ea3d6a (patch)
tree880a5ba4601461b850fbeb727a4186aaebb36c37
parent8570ee6d6757025853666b0710386c2bad706b8d (diff)
downloadframeworks_base-3e1902504979b9b456a14dffa6507ee2d9ea3d6a.zip
frameworks_base-3e1902504979b9b456a14dffa6507ee2d9ea3d6a.tar.gz
frameworks_base-3e1902504979b9b456a14dffa6507ee2d9ea3d6a.tar.bz2
DNG: Fix row stride check.
Bug: 16986715 Change-Id: I5337194f7078d394b9e972e81861794283925612
-rw-r--r--core/jni/android_hardware_camera2_DngCreator.cpp4
1 files changed, 2 insertions, 2 deletions
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 @@ InputStripSource::~InputStripSource() {}
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(JNIEnv* env, const uint8_t* pixelBytes, uin
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,