Skip to contentSkip to conversation

media: venus: dec: Handle the case where find_format fails

git:media_stage/master Mauro Carvalho Chehab 1 participant 1 message Sep 24, 2022

Subsystems (5)
lore
Share & tools
lore

Mauro Carvalho Chehab

author maintainer
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: venus: dec: Handle the case where find_format fails
Author:  Bryan O'Donoghue <[email protected]>
Date:    Tue Jul 26 04:14:54 2022 +0200

Debugging the decoder on msm8916 I noticed the vdec probe was crashing if the fmt pointer was NULL.

A similar fix from Colin Ian King found by Coverity was implemented for the encoder. Implement the same fix on the decoder.

Fixes 7472c1c69138 ("[media] media: venus: vdec: add video decoder files")
Cc [email protected] # v4.13+
 drivers/media/platform/qcom/venus/vdec.c | 2 ++
 1 file changed, 2 insertions(+)

---

drivers/media/platform/qcom/venus/vdec.c +2 -0
index ac0bb45d07f4..4ceaba37e2e5 100644
@@ -183,6 +183,8 @@ vdec_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
 		else
 			return NULL;
 		fmt = find_format(inst, pixmp->pixelformat, f->type);
+		if (!fmt)
+			return NULL;
 	}
 
 	pixmp->width = clamp(pixmp->width, frame_width_min(inst),