Skip to content

Commit

Permalink
vcap/v4l2: fixed conversion of fmt unknown to UG
Browse files Browse the repository at this point in the history
The V4L2 FourCC was an invalid codec_t element and lead to crash in
get_codec_name() on that value few lines below.
  • Loading branch information
MartinPulec committed Jan 22, 2024
1 parent 483d21d commit 49ddf94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/video_capture/v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,7 @@ static int vidcap_v4l2_init(struct vidcap_params *params, void **state)
memcpy(fcc, &fmt.fmt.pix.pixelformat, 4);
fcc[4] = '\0';
log_msg(LOG_LEVEL_WARNING, MOD_NAME "No mapping for FCC '%s', converting to RGB!\n", fcc);
opts.v4l2_convert_to = s->dst_fmt.fmt.pix.pixelformat =
V4L2_PIX_FMT_RGB24;
opts.v4l2_convert_to = RGB;
}
}
if (opts.v4l2_convert_to != VC_NONE) {
Expand Down

0 comments on commit 49ddf94

Please sign in to comment.