Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47849abc authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: fix off by one error

Test: DngCreator CTS test
Bug: 74434422
Change-Id: Ib8aa5f1eec6a5213f6c2c3aeb2d46475107f13c6
parent dea740bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1787,8 +1787,8 @@ static sp<TiffWriter> DngCreator_setup(JNIEnv* env, jobject thiz, uint32_t image
                    results.find(ANDROID_LENS_DISTORTION);
            if (entry3.count == 5) {
                gotDistortion = true;
                float m_x = std::fmaxf(preWidth - cx, cx);
                float m_y = std::fmaxf(preHeight - cy, cy);
                float m_x = std::fmaxf(preWidth-1 - cx, cx);
                float m_y = std::fmaxf(preHeight-1 - cy, cy);
                float m_sq = m_x*m_x + m_y*m_y;
                float m = sqrtf(m_sq); // distance to farthest corner from optical center
                float f_sq = f * f;