This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: YUV420 buffer overflow for odd-dimension frames in VideoBuilder

The UV plane size was calculated as ySize/2 (integer division), but the
UV loop iterates ceil(w/2)*ceil(h/2) times writing 2 bytes each. With
odd width or height the loop writes past the allocated buffer, causing
an ArrayIndexOutOfBoundsException.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+2 -2
+1 -1
posedetection/build.gradle.kts
··· 4 4 5 5 mavenPublishing { 6 6 publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) 7 - coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.9.3") 7 + coordinates("com.performancecoachlab.posedetection", "posedetection-compose", "4.9.4") 8 8 9 9 pom { 10 10 name.set("Pose Detection")
+1 -1
posedetection/src/androidMain/kotlin/com/performancecoachlab/posedetection/encoding/VideoBuilder.android.kt
··· 111 111 112 112 // NV12 format: y plane followed by interleaved uv plane 113 113 val ySize = width * height 114 - val uvSize = ySize / 2 114 + val uvSize = ((width + 1) / 2) * ((height + 1) / 2) * 2 115 115 val yuvSize = ySize + uvSize 116 116 val yuv = ByteArray(yuvSize) 117 117