diff --git a/android/src/main/cpp/iris_rtc_rendering_android.cc b/android/src/main/cpp/iris_rtc_rendering_android.cc index 3b3cea78b..ff4d6e171 100644 --- a/android/src/main/cpp/iris_rtc_rendering_android.cc +++ b/android/src/main/cpp/iris_rtc_rendering_android.cc @@ -117,9 +117,6 @@ class GLContext { == EGL_TRUE; if (!result) { CHECK_GL_ERROR() } - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - CHECK_GL_ERROR() - return result; } @@ -538,6 +535,10 @@ class YUVRendering final : public RenderingOp { glViewport(0, 0, width, height); CHECK_GL_ERROR() + // Ensure that the unpack alignment is set to 1 byte to avoid any alignment issues with YUV data. + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + CHECK_GL_ERROR() + glEnableVertexAttribArray(aPositionLoc_); CHECK_GL_ERROR()