From patchwork Thu Aug 17 22:17:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4732 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp86019vsu; Thu, 17 Aug 2017 15:18:19 -0700 (PDT) X-Received: by 10.28.236.67 with SMTP id k64mr152275wmh.128.1503008299445; Thu, 17 Aug 2017 15:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503008299; cv=none; d=google.com; s=arc-20160816; b=CcrncXDDhjWIA01yHCX6SxqROS5mX9RyLNz8+EMfmCHwpDHxWdx1L0xSNtHtyLSr0V L0ZO9deXqvEGVIHY9Q5TxsH8uVLKxEuEczMhmYQk+SJ4j9gMMB6xTMQlR8Afvw6OfgvL /e4jfV/bluSeoh0QH/0xIAGK7HdeaoSPrarv5qqJSy3YCoOYFLfFgi5okRJZdBM0QcIr joT34lL4a2U2Wp/1TAKngrQ/ioXx7vY6q3df0R/O/gRHyv8isEZDEqX+lGoeuTD4UjvX V4liOWtUf8Bkt1hbuPvHNa8xB2BY7npC5GCrVDEK5/DSjAMIA4kYJ67NQ3FOOPcathtf M25A== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=FtYewSshYyImACLYopXJo2uhJIC+Y9c73gLDqngzvRk=; b=J7PN69Bm/e7xQ9H/K7UXBkfiOdg1Fv5y3MMN/iK/bpsYyXHM8eQjuuDsGQ/GsD4UO3 TnGF4P8u9riijxZkw8VhrkT1yXyn3D/gEcesQh2SSTVrkBgHsrgH/VRYebHaqFpc9rTt vnK4mosYfNhyiFAr+SfrH05eQHrWKDJtMtctvy31PTPWBttb7w082iJyUWUFciDWDMC9 S+kE6DsDyyz3hfLjU73lB/j7U1k6f5UE8Dak/OHzbnO4FKJg3Mz6z9cQnMxCJvBnDVEd zda5YYG7eer5phBMVYbnPTVSFG6rhaDAlXRWAMYgBj0xbHoHFk93CF9kjSDCt9gyZrjh /2lA== 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 s45si3176055wrc.511.2017.08.17.15.18.15; Thu, 17 Aug 2017 15:18:19 -0700 (PDT) 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 9014768975F; Fri, 18 Aug 2017 01:17:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (unknown [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DBBED680A18 for ; Fri, 18 Aug 2017 01:17:47 +0300 (EEST) Received: from [172.31.218.34] (helo=vie01a-dmta-pe02-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1diT6v-0001aO-BJ for ffmpeg-devel@ffmpeg.org; Fri, 18 Aug 2017 00:17:53 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1diT6p-00031V-Rd for ffmpeg-devel@ffmpeg.org; Fri, 18 Aug 2017 00:17:47 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id yNHd1v01i0S5wYM01NHemg; Fri, 18 Aug 2017 00:17:38 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 18 Aug 2017 00:17:34 +0200 Message-Id: <20170817221735.24154-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170817221735.24154-1-michael@niedermayer.cc> References: <20170817221735.24154-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/snowdec: Fix off by 1 error 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: runtime error: index 4 out of bounds for type 'int8_t [4]' Fixes: 3023/clusterfuzz-testcase-minimized-6421736130084864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/snowdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index c80901b754..734f43e7d1 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -355,7 +355,7 @@ static int decode_header(SnowContext *s){ Plane *p= &s->plane[plane_index]; p->diag_mc= get_rac(&s->c, s->header_state); htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2; - if((unsigned)htaps > HTAPS_MAX || htaps==0) + if((unsigned)htaps >= HTAPS_MAX || htaps==0) return AVERROR_INVALIDDATA; p->htaps= htaps; for(i= htaps/2; i; i--){