diff options
author | 2008-12-22 13:33:43 +0000 | |
---|---|---|
committer | 2008-12-22 13:33:43 +0000 | |
commit | d05f018be177bd635ec817417b7f841db2d4ba84 (patch) | |
tree | cd07b7db448ad808843298fca67d36c25fbba288 /sys/dev | |
parent | Fix few cases where "smtpctl showqueue" could exit prematurely (diff) | |
download | wireguard-openbsd-d05f018be177bd635ec817417b7f841db2d4ba84.tar.xz wireguard-openbsd-d05f018be177bd635ec817417b7f841db2d4ba84.zip |
Fix some logic in the isight specific stream header decode function
(still doesn't work).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/uvideo.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 2ae9ddf3c75..7d2b4539b2c 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.112 2008/12/22 09:45:46 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.113 2008/12/22 13:33:43 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -1918,10 +1918,9 @@ uvideo_vs_decode_stream_header_isight(struct uvideo_softc *sc, uint8_t *frame, 0x11, 0x22, 0x33, 0x44, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xfa, 0xce }; - if (frame_size < 30) - return (USBD_INVAL); - - if (!memcmp(&frame[2], magic, 12) || !memcmp(&frame[3], magic, 12)) + if (frame_size > 13 && !memcmp(&frame[2], magic, 12)) + header = 1; + if (frame_size > 14 && !memcmp(&frame[3], magic, 12)) header = 1; if (header && fb->fid == 0) { |