summaryrefslogtreecommitdiffstats
path: root/media/jni
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-09-16 09:49:28 -0700
committerZhijun He <zhijunhe@google.com>2013-09-16 09:49:28 -0700
commitcfa553369fd8ef68db751fe1052cd17fd5763965 (patch)
tree7597932249f1e90af2518aaeb239540cf9d8fc28 /media/jni
parent750ce3acf23e5c2e5b239154a2539391544f9463 (diff)
downloadframeworks_base-cfa553369fd8ef68db751fe1052cd17fd5763965.zip
frameworks_base-cfa553369fd8ef68db751fe1052cd17fd5763965.tar.gz
frameworks_base-cfa553369fd8ef68db751fe1052cd17fd5763965.tar.bz2
ImageReader: get correct crop size
Bug: 10752797 Change-Id: I2e56d69cde7f5ca669a366646b876861b277a239
Diffstat (limited to 'media/jni')
-rw-r--r--media/jni/android_media_ImageReader.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/media/jni/android_media_ImageReader.cpp b/media/jni/android_media_ImageReader.cpp
index 94f20bc..16b45be 100644
--- a/media/jni/android_media_ImageReader.cpp
+++ b/media/jni/android_media_ImageReader.cpp
@@ -739,11 +739,9 @@ static jboolean ImageReader_imageSetup(JNIEnv* env, jobject thiz,
int outputHeight = buffer->height;
// Correct width/height when crop is set.
- if (buffer->crop.getWidth() > 0) {
- outputWidth = buffer->crop.getWidth() + 1;
- }
- if (buffer->crop.getHeight() > 0) {
- outputHeight = buffer->crop.getHeight() + 1;
+ if (buffer->crop.isValid()) {
+ outputWidth = buffer->crop.getWidth();
+ outputHeight = buffer->crop.getHeight();
}
int imageReaderWidth = ctx->getBufferWidth();