summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2009-02-06 14:24:45 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2009-02-06 14:24:45 +0000
commit10ef0fe29da83a2ba2df1b9ae94952d31b9a4dd5 (patch)
treea2b6deed74b8f3473df1d0bf1b3950a21130ad5a /sys
parent56479cbca394d0ad1670c4d739085d02bc666b26 (diff)
Fix kernel crash (page fault) for devices with unsorted frame index.
Problem reported by Kenji Aoyama
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uvideo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 71843e1691f..634b9c4a8cf 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.114 2008/12/22 20:51:18 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.115 2009/02/06 14:24:44 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -1000,7 +1000,7 @@ uvideo_vs_parse_desc_frame_mjpeg(struct uvideo_softc *sc,
sc->sc_fmtgrp[fmtidx].frame_num++;
- if (d->bFrameIndex ==
+ if (sc->sc_fmtgrp[fmtidx].frame_num ==
sc->sc_fmtgrp[fmtidx].format->bNumFrameDescriptors)
sc->sc_fmtgrp_idx++;
@@ -1037,7 +1037,7 @@ uvideo_vs_parse_desc_frame_uncompressed(struct uvideo_softc *sc,
sc->sc_fmtgrp[fmtidx].frame_num++;
- if (d->bFrameIndex ==
+ if (sc->sc_fmtgrp[fmtidx].frame_num ==
sc->sc_fmtgrp[fmtidx].format->bNumFrameDescriptors)
sc->sc_fmtgrp_idx++;