media: mediatek: vcodec: Coverity issues in encoder driver
authorIrui Wang <irui.wang@mediatek.com>
Mon, 3 Apr 2023 09:43:42 +0000 (10:43 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 15 Apr 2023 07:39:22 +0000 (08:39 +0100)
commitbb02a201b63e6ae80a412b1673e9888d30ca5d1a
treeec224a46aa4a629e77f22b8678df27163a131d9b
parent8fbcf730cb89c3647f3365226fe7014118fa93c7
media: mediatek: vcodec: Coverity issues in encoder driver

CERT-C Characters and Strings:
check core id is in valid range:
dev->reg_base[dev->venc_pdata->core_id] evaluates to an address
that could be at negative offset of an array.

CERT-C Expression:
check buf is not NULL before used:
Dereferencing buf, which is known to be NULL.

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c