summaryrefslogtreecommitdiffstats
path: root/media/jni/android_media_ImageReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/jni/android_media_ImageReader.cpp')
-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();