Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/class/video/video_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ static bool _open_vc_itf(uint8_t rhport, videod_interface_t *self, uint_fast8_t
TU_ASSERT(vc->ctl.bInCollection <= CFG_TUD_VIDEO_STREAMING);

/* Update to point the end of the video control interface descriptor. */
end = _end_of_control_descriptor(cur);
end = _end_of_control_descriptor(cur) + 7;
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extending end by a hard-coded 7 bytes inside _open_vc_itf() fixes the endpoint search, but the same endpoint lookup pattern in _close_vc_itf() still uses _end_of_control_descriptor() without extending the search range and will return end/assert when bNumEndpoints != 0. Consider introducing a helper that computes the true end of the VC interface including the notification endpoint descriptor(s) (only when bNumEndpoints is non-zero), and use it in both open/close so behavior stays consistent.

Copilot uses AI. Check for mistakes.

/* Advance to the next descriptor after the class-specific VC interface header descriptor. */
cur += vc->std.bLength + vc->ctl.bLength;
Expand Down
Loading