util/rbsp: Fill bits twice if reading more than 16 bits
authorDavid Rosca <nowrep@gmail.com>
Sun, 19 Nov 2023 10:27:29 +0000 (11:27 +0100)
committerEric Engestrom <eric@engestrom.ch>
Fri, 24 Nov 2023 17:15:18 +0000 (17:15 +0000)
commit142c333748e052b47bdfd2c224ae905bbd24d41c
treede340db811d7c5011cffd343aa7fe88c223a360a
parentc05aadcf25acfdf259dc27001aa9cc4332f385e4
util/rbsp: Fill bits twice if reading more than 16 bits

vl_rbsp_fillbits may fill less than 32 bits if it removes emulation
prevention bytes, but will fill at least 16 bits. We need to call it
twice when reading more than 16 bits.

This fixes parsing H264 SPS packed header in va frontend when emulation
prevention bytes are at position where 32 bit values are read.

Cc: mesa-stable
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26276>
(cherry picked from commit 73d69ef1e6b013f923ec459c789976570baaf447)
.pick_status.json
src/util/vl_rbsp.h