media: mediatek: vcodec: fix h264 cavlc bitstream fail
authorYunfei Dong <yunfei.dong@mediatek.com>
Tue, 18 Oct 2022 11:41:22 +0000 (19:41 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 24 Oct 2022 17:03:54 +0000 (19:03 +0200)
commitd555409dd1b7cc9e7e5b9e2924c0ef4bf23f6c9b
treecb2b28bfa50a43da5fe26a502877e61b71db5dcf
parente9120e76a6f7e19a8d26c03f2964937e4ce69784
media: mediatek: vcodec: fix h264 cavlc bitstream fail

Some cavlc bistream will decode fail when the frame size is less than
20 bytes. Need to add pending data at the end of the bitstream.

For the minimum size of mapped memory is 256 bytes(16x16), adding four
bytes data won't lead to access unknown virtual memory.

Fixes: 59fba9eed5a7 ("media: mediatek: vcodec: support stateless H.264 decoding for mt8192")
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c