From 6bed3968c563fc55c7a2306453302a03d6bac517 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Sat, 26 Mar 2011 08:24:53 +0000 Subject: use 'sizeof(struct usb_video_frame_desc)' instead of a hardcoded number --- sys/dev/usb/uvideo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb') diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index a32c7fe4e0a..2193a0d4bfb 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.156 2011/03/26 08:21:27 jakemsr Exp $ */ +/* $OpenBSD: uvideo.c,v 1.157 2011/03/26 08:24:52 jakemsr Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -634,7 +634,8 @@ uvideo_vc_parse_desc(struct uvideo_softc *sc) break; case UDESCSUB_VC_PROCESSING_UNIT: /* XXX do correct length calculation */ - if (desc->bLength < 25) { + if (desc->bLength < + sizeof(struct usb_video_frame_desc)) { (void)uvideo_vc_parse_desc_pu(sc, desc); } break; -- cgit v1.2.3