[PATCH v2 4/6] media: uvcvideo: Use bHeaderLength to detect empty packets in clock decode

From: Ricardo Ribalda

Date: Mon Nov 16 2026 - 12:52:58 EST


Use the full header size (data[0]) instead of the minimum header size to
decide if a packet contains payload data or not.

This fixes the heuristic on affected devices if they also include
extended header data such as MSXU metadata.

Fixes: 5cd7c25f6f05 ("media: uvcvideo: Ignore empty TS packets")
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index ac8e0c3a0c71..a822b8234789 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -641,7 +641,7 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf,
* clock sample from many and the clock recovery algorithm wouldn't
* suffer from this condition.
*/
- if (buf && buf->bytesused == 0 && len == header_size &&
+ if (buf && buf->bytesused == 0 && len == data[0] &&
sample.dev_stc == 0 && sample.dev_sof == 0)
return;


--
2.56.0.679.gc527c65306-goog