]> git.baikalelectronics.ru Git - kernel.git/commit
media: cedrus: hevc: Add check for invalid timestamp
authorJernej Skrabec <jernej.skrabec@gmail.com>
Mon, 18 Jul 2022 16:56:49 +0000 (18:56 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 27 Jul 2022 18:27:10 +0000 (20:27 +0200)
commit2986a7a5bcf61459d3bfa98b2e85219e336a9152
treed29bbcd24e48d0148c94eb6ef434363cb8dfcfdc
parent7c7ebc22fc2ff56c79fd70dbc83fd6fabda0a5fd
media: cedrus: hevc: Add check for invalid timestamp

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: 08841d682c66 ("media: cedrus: Add HEVC/H.265 decoding support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus_h265.c