Skip to content

Commit 83cc71f

Browse files
authored
Merge pull request hathach#1820 from Staacks/master
Fix UVC probe and commit on MacOS
2 parents 79e5d7a + 95ba158 commit 83cc71f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/class/video/video_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
917917
switch (request->bRequest) {
918918
case VIDEO_REQUEST_SET_CUR:
919919
if (stage == CONTROL_STAGE_SETUP) {
920-
TU_VERIFY(sizeof(video_probe_and_commit_control_t) == request->wLength, VIDEO_ERROR_UNKNOWN);
920+
TU_VERIFY(sizeof(video_probe_and_commit_control_t) >= request->wLength, VIDEO_ERROR_UNKNOWN);
921921
TU_VERIFY(tud_control_xfer(rhport, request, self->ep_buf, sizeof(video_probe_and_commit_control_t)),
922922
VIDEO_ERROR_UNKNOWN);
923923
} else if (stage == CONTROL_STAGE_DATA) {
@@ -973,7 +973,7 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
973973
switch (request->bRequest) {
974974
case VIDEO_REQUEST_SET_CUR:
975975
if (stage == CONTROL_STAGE_SETUP) {
976-
TU_VERIFY(sizeof(video_probe_and_commit_control_t) == request->wLength, VIDEO_ERROR_UNKNOWN);
976+
TU_VERIFY(sizeof(video_probe_and_commit_control_t) >= request->wLength, VIDEO_ERROR_UNKNOWN);
977977
TU_VERIFY(tud_control_xfer(rhport, request, self->ep_buf, sizeof(video_probe_and_commit_control_t)), VIDEO_ERROR_UNKNOWN);
978978
} else if (stage == CONTROL_STAGE_DATA) {
979979
TU_VERIFY(_update_streaming_parameters(self, (video_probe_and_commit_control_t*)self->ep_buf), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE);

0 commit comments

Comments
 (0)