From patchwork Thu Aug 4 15:40:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jones X-Patchwork-Id: 7573 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Thu, 04 Aug 2011 15:41:17 +0000 Received: from casper.infradead.org [85.118.1.10] by localhost.localdomain with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 04 Aug 2011 12:42:02 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qp02u-00004s-SL; Thu, 04 Aug 2011 15:41:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754579Ab1HDPlO (ORCPT + 1 other); Thu, 4 Aug 2011 11:41:14 -0400 Received: from mail1.matrix-vision.com ([78.47.19.71]:40504 "EHLO mail1.matrix-vision.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766Ab1HDPlO (ORCPT ); Thu, 4 Aug 2011 11:41:14 -0400 Received: from mail1.matrix-vision.com (localhost [127.0.0.1]) by mail1.matrix-vision.com (Postfix) with ESMTP id DFEAF722AC; Thu, 4 Aug 2011 17:41:12 +0200 (CEST) Received: from erinome (g2.matrix-vision.com [80.152.136.245]) by mail1.matrix-vision.com (Postfix) with ESMTPA id B592F721B4; Thu, 4 Aug 2011 17:41:12 +0200 (CEST) Received: from erinome (localhost [127.0.0.1]) by erinome (Postfix) with ESMTP id E40796F8A; Thu, 4 Aug 2011 17:41:11 +0200 (CEST) Received: by erinome (Postfix, from userid 108) id D75226F9C; Thu, 4 Aug 2011 17:41:11 +0200 (CEST) Received: from ap437-joe.intern.matrix-vision.de (host65-46.intern.matrix-vision.de [192.168.65.46]) by erinome (Postfix) with ESMTPA id BAF546F8A; Thu, 4 Aug 2011 17:41:11 +0200 (CEST) From: Michael Jones To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH] [media] omap3isp: queue: fail QBUF if buffer is too small Date: Thu, 4 Aug 2011 17:40:37 +0200 Message-Id: <1312472437-26231-1-git-send-email-michael.jones@matrix-vision.de> X-Mailer: git-send-email 1.7.6 X-MV-Disclaimer: true (erinome) X-AV-Checked: ClamAV using ClamSMTP (erinome) X-AV-Checked: ClamAV using ClamSMTP (mail1) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add buffer length to sanity checks for QBUF. Signed-off-by: Michael Jones --- drivers/media/video/omap3isp/ispqueue.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/omap3isp/ispqueue.c b/drivers/media/video/omap3isp/ispqueue.c index 9c31714..4f6876f 100644 --- a/drivers/media/video/omap3isp/ispqueue.c +++ b/drivers/media/video/omap3isp/ispqueue.c @@ -867,6 +867,9 @@ int omap3isp_video_queue_qbuf(struct isp_video_queue *queue, if (buf->state != ISP_BUF_STATE_IDLE) goto done; + if (vbuf->length < buf->vbuf.length) + goto done; + if (vbuf->memory == V4L2_MEMORY_USERPTR && vbuf->m.userptr != buf->vbuf.m.userptr) { isp_video_buffer_cleanup(buf);