Skip to content

Commit

Permalink
media: venus: dec: Handle the case where find_format fails
Browse files Browse the repository at this point in the history
commit 06a2da3 upstream.

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: 7472c1c ("[media] media: venus: vdec: add video decoder files")
Cc: stable@vger.kernel.org  # v4.13+
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
0xB0D authored and gregkh committed Oct 29, 2022
1 parent b22b482 commit fcc96e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/platform/qcom/venus/vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,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),
Expand Down

0 comments on commit fcc96e8

Please sign in to comment.