Commit 349cecc9 authored by Jernej Skrabec's avatar Jernej Skrabec Committed by Zheng Zengkai
Browse files

media: cedrus: hevc: Add check for invalid timestamp

stable inclusion
from stable-v5.10.137
commit 420cf3b781b2033e830c7fce47cae5462a28ea42
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=420cf3b781b2033e830c7fce47cae5462a28ea42



--------------------------------

[ Upstream commit 143201a6 ]

Not all DPB entries will be used most of the time. Unused entries will
thus have invalid timestamps. They will produce negative buffer index
which is not specifically handled. This works just by chance in current
code. It will even produce bogus pointer, but since it's not used, it
won't do any harm.

Let's fix that brittle design by skipping writing DPB entry altogether
if timestamp is invalid.

Fixes: 86caab29 ("media: cedrus: Add HEVC/H.265 decoding support")
Signed-off-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 5fbfaa40
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment