← All reports

Native `GPUVideoDecoderVTBH265` with HEVCUtilities NAL/VPS parsing

Component: WebKit WebRTC codecs | d9eaeec

WebRTC video decoding happens in the sandboxed GPU process: a WebContent process negotiates a codec and the GPU process instantiates the decoder (via LibWebRTCCodecsProxy) for frames arriving from a remote peer. Annex-B H265 streams are self-delimited by NAL start codes and carry VPS/SPS/PPS parameter sets that must be bit-parsed to build a CMFormatDescription. This commit adds GPUVideoDecoderVTBH265, a native VideoToolbox-backed H265 decoder replacing libwebrtc's RTCVideoDecoderH265, and extends HEVCUtilities with NAL-scanning and VPS parsing/conversion, wired in via LibWebRTCCodecsProxy::createLocalDecoder.

H265 bitstream parsing for incoming WebRTC video moves from a third-party library into WebKit's own code in the GPU process, directly reachable by a remote WebRTC peer.

Narrow: the new HEVCUtilities NAL-boundary scan and VPS field extraction (e.g. max-reorder-pics) parse an attacker-influenced byte stream — audit bounds on start-code scanning and parameter-set length fields. Wider: the SPS/PPS parsing paths in the same shared layer carry the same remote-peer reachability; review all HEVCUtilities parameter-set parsers. The tell: a bit-reader advancing on a length read from the stream without a remaining-bytes check.