From patchwork Sun May 21 18:46:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3711 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp1125292vsk; Sun, 21 May 2017 11:46:29 -0700 (PDT) X-Received: by 10.223.178.236 with SMTP id g99mr8461024wrd.126.1495392389872; Sun, 21 May 2017 11:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495392389; cv=none; d=google.com; s=arc-20160816; b=pfxMhFMy2gAC8F9KvhLE1OXTE0R/9+hvIBbii4lgsLWuXLFuRV6VuGGIRpX5C379+x eZEiMxCYKHyxRem5N9DuXZON7zDtWTBYUVNVTH/I8uB3U1g6OiTtytpNJOBRUN5IktOt cih/DofdFADmYEOYC7H4C2HToAMIiEH0WG9Qm1gO4OWYdUVX1BIIlpzGnij3Jqf/F371 uV88ZhBHONQPdL1GoyvRMlpBF4kjaDKpnH2Sj1MS9xcWshalW0Lq7xmc36C84WPnQIZt R5owf5TQ/wTCwzSxBVrGM8vtImh6vqhqzBVt683Tyw3i3Z4uelMYwJFmF0rTrDHloS/D ozxA== 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=9eqScDdmZi8G5rrSf7is39ep2p986yqJYyru/ePV/u0=; b=j+W0QonINyG6qALjLdEP7x8+zR+kvJBWn4HeMuQ5y730EcNdZ2FUFSOJAxtuHsnQ3p acTpfBIBrOuSTtddSMoeVfB81UtSMVL7HiaPh797CFGyL1U2wEJ7dgFb1hkigThyFU6r gvcht1khWU8lGTVaPoLvXjyy5+b4+U59UrwsKpsj98ZLU+xfdL9uy0MA8Mqzx8AAwc/e DgFMAGhElrf26sYN4GCP+iCPyIgwsrICAokEIwLtE4SWDpI8iAnF3fOXAD5wUAoLJcSQ 7tjYJdaaZhouXaGBSaWXoW3QMFNZDFlPQW0z1qtsdrliA8NT966DXsScjmIeLn4wNPte VNhw== 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 j26si9451526wrc.6.2017.05.21.11.46.29; Sun, 21 May 2017 11:46:29 -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 0BE4B689982; Sun, 21 May 2017 21:46:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 88BE06898DC for ; Sun, 21 May 2017 21:46:18 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dCVru-0001au-Ur for ffmpeg-devel@ffmpeg.org; Sun, 21 May 2017 20:46:18 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id P6mG1v01V0S5wYM016mH3u; Sun, 21 May 2017 20:46:17 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 21 May 2017 20:46:16 +0200 Message-Id: <20170521184616.13847-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/aacps: Check border_position to be monotone 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: left shift of negative value -67108864 Fixes: 1738/clusterfuzz-testcase-minimized-6734814327603200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/aacps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c index 48b595adbd..31e072dd49 100644 --- a/libavcodec/aacps.c +++ b/libavcodec/aacps.c @@ -196,8 +196,13 @@ int AAC_RENAME(ff_ps_read_data)(AVCodecContext *avctx, GetBitContext *gb_host, P ps->border_position[0] = -1; if (ps->frame_class) { - for (e = 1; e <= ps->num_env; e++) + for (e = 1; e <= ps->num_env; e++) { ps->border_position[e] = get_bits(gb, 5); + if (ps->border_position[e] < ps->border_position[e-1]) { + av_log(avctx, AV_LOG_ERROR, "border_position non monotone.\n"); + goto err; + } + } } else for (e = 1; e <= ps->num_env; e++) ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;