diff options
| author | Ha Thach <[email protected]> | 2023-01-07 23:30:30 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-07 23:30:30 +0700 |
| commit | 83cc71feaf442842e498343b5a3128f4735216bb (patch) | |
| tree | af907595f4af41ce5cfffef44eac54209031ab29 /src | |
| parent | 79e5d7aa69ee5912bcc1a561ca452771440eb10f (diff) | |
| parent | 95ba158a1070635551b01d921cb4c5eeb7734989 (diff) | |
Merge pull request #1820 from Staacks/master
Fix UVC probe and commit on MacOS
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/video/video_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/class/video/video_device.c b/src/class/video/video_device.c index a6d2724c1..e17d0a90f 100644 --- a/src/class/video/video_device.c +++ b/src/class/video/video_device.c @@ -917,7 +917,7 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage, switch (request->bRequest) { case VIDEO_REQUEST_SET_CUR: if (stage == CONTROL_STAGE_SETUP) { - TU_VERIFY(sizeof(video_probe_and_commit_control_t) == request->wLength, VIDEO_ERROR_UNKNOWN); + TU_VERIFY(sizeof(video_probe_and_commit_control_t) >= request->wLength, VIDEO_ERROR_UNKNOWN); TU_VERIFY(tud_control_xfer(rhport, request, self->ep_buf, sizeof(video_probe_and_commit_control_t)), VIDEO_ERROR_UNKNOWN); } else if (stage == CONTROL_STAGE_DATA) { @@ -973,7 +973,7 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage, switch (request->bRequest) { case VIDEO_REQUEST_SET_CUR: if (stage == CONTROL_STAGE_SETUP) { - TU_VERIFY(sizeof(video_probe_and_commit_control_t) == request->wLength, VIDEO_ERROR_UNKNOWN); + TU_VERIFY(sizeof(video_probe_and_commit_control_t) >= request->wLength, VIDEO_ERROR_UNKNOWN); TU_VERIFY(tud_control_xfer(rhport, request, self->ep_buf, sizeof(video_probe_and_commit_control_t)), VIDEO_ERROR_UNKNOWN); } else if (stage == CONTROL_STAGE_DATA) { TU_VERIFY(_update_streaming_parameters(self, (video_probe_and_commit_control_t*)self->ep_buf), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE); |
