Android security tags, read closely by Lightrion

CVE-2025-26455 AI-generated analysis

platform/frameworks/av, media/ndk (libmediandk AMediaCodec wrapper)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (7 corrections). Verify against the commit before relying on it.

Makes the pointer/size pairs returned by the NDK AMediaCodec_getInputBuffer and AMediaCodec_getOutputBuffer APIs consistent (input: base pointer with capacity; output: data pointer with actual size) and sets the offset reported by AMediaCodec_dequeueOutputBuffer to 0 because the output pointer is already offset.

Root cause

In media/ndk/NdkMediaCodec.cpp, AMediaCodec_getInputBuffer returned abuf->data() while reporting *out_size = abuf->capacity(); per the commit message this erroneously considered the buffer offset and could result in a smaller input buffer being returned and client confusion. AMediaCodec_getOutputBuffer returned data() but reported capacity() rather than size(), so per the commit message the reported size included padding after the output buffer. AMediaCodec_dequeueOutputBuffer copied the codec's internal offset into AMediaCodecBufferInfo.offset even though, per the fix comment, the output buffer address is already offset in AMediaCodec_getOutputBuffer, so a client honoring info.offset would apply it twice. The pattern existed in both the asynchronous (mCodec->getInputBuffer/getOutputBuffer) and synchronous (getInputBuffers/getOutputBuffers vector) branches.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to June 2025 · Findings