summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2026-08-15 05:51:43 +0200
committerHiFiPhile <[email protected]>2026-08-15 05:56:10 +0200
commit8737c5adfca7e51003e743bcc8bcefed837fb1d8 (patch)
treea9004f37ce902596f6adedb25bcdf5fa2a90f849 /src
parent15dd3120ac4a9dea0d979dc541ef8e0f52f5aa26 (diff)
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/class/video/video_device.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/class/video/video_device.c b/src/class/video/video_device.c
index 390349f13..770595178 100644
--- a/src/class/video/video_device.c
+++ b/src/class/video/video_device.c
@@ -1144,13 +1144,10 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
video_probe_and_commit_control_t *param = &stm->probe_commit_payload;
TU_VERIFY(_update_streaming_parameters(stm, param), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE);
/* Set the negotiated value */
- stm->max_payload_transfer_size = param->dwMaxPayloadTransferSize;
- /* A host may commit before the parameters are fully negotiated, in which case
- * _update_streaming_parameters returns early without capping the payload size.
- * Clamp here so a bulk stream cannot overrun the endpoint buffer. */
- if (CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE < stm->max_payload_transfer_size) {
- stm->max_payload_transfer_size = CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE;
+ if (CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE < param->dwMaxPayloadTransferSize) {
+ param->dwMaxPayloadTransferSize = CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE;
}
+ stm->max_payload_transfer_size = param->dwMaxPayloadTransferSize;
int ret = tud_video_commit_cb(stm->index_vc, stm->index_vs, param);
if (VIDEO_ERROR_NONE == ret) {
stm->state = VS_STATE_COMMITTED;