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

Commit 086bd7fe authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 6846 into donut

* changes:
  Avoid memcpy's by using GetPrimitiveArrayCritical.
parents 1c9fb40c 75acd896
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -143,9 +143,9 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int
                LOGE("Couldn't allocate byte array for JPEG data");
                env->ExceptionClear();
            } else {
                jbyte *bytes = env->GetByteArrayElements(obj, NULL);
                jbyte *bytes = static_cast<jbyte*>(env->GetPrimitiveArrayCritical(obj, NULL));
                memcpy(bytes, data, size);
                env->ReleaseByteArrayElements(obj, bytes, 0);
                env->ReleasePrimitiveArrayCritical(obj, bytes, 0);

            }
        } else {