From patchwork Fri Feb 2 22:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7494 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.150.1 with SMTP id c1csp922562jai; Fri, 2 Feb 2018 14:18:45 -0800 (PST) X-Google-Smtp-Source: AH8x224okgiC3t7k1e1/J0mEpz1iND66DwvhRMOGtl+msCHbXZypoLoa8zQhSZBk+jgXfyqw3b44 X-Received: by 10.223.173.239 with SMTP id w102mr27061952wrc.110.1517609924949; Fri, 02 Feb 2018 14:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517609924; cv=none; d=google.com; s=arc-20160816; b=03xHbWKAK2/iYbdKOCq+ZB8JzfuJscfJQ39H6iUpZWusJuYIfTHi50wTlprlQgBhPx xjSWZ9Lp643Ek3/GpXqMOaPBQ4KyZd5jhQSuvpV1s/yFTmacTLk9+gJrorO/olIxJD77 g7DvjNcWDRaqY+D2xJrkNi01whWfalPX0uTv9XYca6K3Fw3DEKtelKaa9v/PAkybjhaW 4oZYa7ThiolNdQ6PA4A38M+elKIuBhb42hoMyXgGPydAMaHOmC/NxUuVIw6DYFiL5cxl 3mTG+8CX+uljLZZvpvo1DBtkcLQCEjMUVJAQj2YmlY6azdOqJJnvvBmnY3ju1tv0wXOV JInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=qsbVk30bPX1xk/laMurx//cZu4PLyKyqthu8ROoLcAc=; b=A1R1uqXKsizxNeCBUGDTTvWq3OV/aZ2i3gWvr8j1aSegQshDm/HRVtP0tCkWjyi2s6 +t1CnWjib3AJLRvVgyHEFhrrjsibjE8iwJ7mJUmBEshPfYTZU2lYOfsNj67posOn5p8s i6RurD7uFLPCiMT2t7hkUVsVmg6yO6/eXSctwLIgAV7MmvEpYH3CMtfoI+ADPiezegMC JY9L5M8bigLapSLFJI8OeXjTtl8J0s33vYCesXIS1Havk8xFqQ+NDPe7BrpGF1Y3s+pN gitw4a08hKm5kOJLF/nH8wJ10Ro4T6rt4nR01YCdIQ6BAup9G8WEVIcL692DTwTC0w6d qgwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f35si2491998wra.391.2018.02.02.14.18.44; Fri, 02 Feb 2018 14:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3737E68831C; Sat, 3 Feb 2018 00:18:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-1.mx.upcmail.net (vie01a-qmta-pe02-1.mx.upcmail.net [62.179.121.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF41D687EAF for ; Sat, 3 Feb 2018 00:18:30 +0200 (EET) Received: from [172.31.218.47] (helo=vie01a-dmta-pe06-2.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ehjfI-0006OH-Ke for ffmpeg-devel@ffmpeg.org; Fri, 02 Feb 2018 23:18:36 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ehjfD-0003M8-2N for ffmpeg-devel@ffmpeg.org; Fri, 02 Feb 2018 23:18:31 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 5yJU1x01Z0S5wYM01yJVzc; Fri, 02 Feb 2018 23:18:30 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 2 Feb 2018 23:18:28 +0100 Message-Id: <20180202221828.3889-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.16.1 Subject: [FFmpeg-devel] [PATCH] avcodec/utvideodec: Fix bytes left check in decode_frame() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: out of array read Fixes: poc-2017.avi Found-by: GwanYeong Kim Signed-off-by: Michael Niedermayer --- libavcodec/utvideodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 608c8c4998..1bcd14e74c 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -676,7 +676,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, for (j = 0; j < c->slices; j++) { slice_end = bytestream2_get_le32u(&gb); if (slice_end < 0 || slice_end < slice_start || - bytestream2_get_bytes_left(&gb) < slice_end) { + bytestream2_get_bytes_left(&gb) < slice_end + 1024LL) { av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n"); return AVERROR_INVALIDDATA; }