From 10ef0fe29da83a2ba2df1b9ae94952d31b9a4dd5 Mon Sep 17 00:00:00 2001 From: Marcus Glocker Date: Fri, 6 Feb 2009 14:24:45 +0000 Subject: Fix kernel crash (page fault) for devices with unsorted frame index. Problem reported by Kenji Aoyama --- sys/dev/usb/uvideo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys') 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 @@ -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++; -- cgit v1.2.3