From patchwork Thu May 17 23:48:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9005 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp4670647jad; Thu, 17 May 2018 16:50:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZolHCpQ7F2jfvJcFg/bPvMDpuRlhd8cY/ejycRPvRVk7poSZtKxXGbDu0LcZ/qAs417Ao1K X-Received: by 2002:a1c:9dc6:: with SMTP id g189-v6mr3285311wme.50.1526601034656; Thu, 17 May 2018 16:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526601034; cv=none; d=google.com; s=arc-20160816; b=nSy+yg4NsNRcgxMSkVbWplZKTn0lAoJah++uQlYCVsBirhZb77jLrJoTZLKQVXjXYf t16VByqmpTnfWeGvSjpy2HbiFLd5w52l3Zgr0TIfv/puFDualKtZ0BStENScvSKQGtN8 XsHfoTjD4h53qw6T86SzfEi80QVfL1T1MfBlkGMFjcmp/87CGPydRWWKNNP0JbXkGAW9 f1RJ2okfoy055HxFzoUG8OTDUuYgkLWu8CexglGKn+48ZVMWtux89ymmkLGopIMdBUFr ujzSkDvqIKJO4USMTFWULY8cZ5DxA0LTgR0KqeOZCXRvOWh4TuuvavxeU5d9ybJ4tpHl GcLA== 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=wFlcQ4oq7nxh+iIJIpSqccg/s9o7XRmfoJn+Uhn+93s=; b=fm6T1hSmbUJL/iFGZmqjFSUh3xR3LXZOG3WdxyDl9iX33mzpNOUX1KsOeftCCLHLAP qkiyDWUwuI8JC2kzndmSIYaRl0eV1136+2FLap2O/00nvTbfe4PPIVGL3Zbk9YBhY75A XgwVxJ+XKCYcLomhW0jWc9PXfUMbJshn2409NGn5Va5H8xmmeov6wTsNIfnlCmbZhVZ2 AY9JRvoGrJ2vx8igtwUxOI32Cf2Ctm+eq5+hte2d3v3FAx5duHKZBpcmp39BoS42Xyan F27TM8dCZpoic7nlmHNDbMUCyPL13IFebCgmcUi4z6H9YlrUCFETqvCJOEW/lsz03Ky6 fniA== 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 u55-v6si5810967wrf.181.2018.05.17.16.50.33; Thu, 17 May 2018 16:50:34 -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 A09EC68A50F; Fri, 18 May 2018 02:49:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-2.mx.upcmail.net (vie01a-qmta-pe02-2.mx.upcmail.net [62.179.121.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B77768A034 for ; Fri, 18 May 2018 02:49:46 +0300 (EEST) Received: from [172.31.218.50] (helo=vie01a-dmta-pe07-2.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fJSfB-0000jA-CC for ffmpeg-devel@ffmpeg.org; Fri, 18 May 2018 01:50:25 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fJSf5-0001Cr-5M for ffmpeg-devel@ffmpeg.org; Fri, 18 May 2018 01:50:19 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id nbqA1x01D0S5wYM01bqBsx; Fri, 18 May 2018 01:50:12 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 18 May 2018 01:48:38 +0200 Message-Id: <20180517234838.19496-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 Subject: [FFmpeg-devel] [PATCH] avcodec/ac3dec: Use frame_size if superframe_size is 0 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: Infinite loop Fixes: 7669/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4689042185650176 Fixes: 7670/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_AC3_fuzzer-4706306762997760 Fixes: 7672/clusterfuzz-testcase-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-4702108499574784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/ac3dec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index b14d2e74ac..1d3180b935 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1800,6 +1800,9 @@ dependent_frame: *got_frame_ptr = 1; + if (!s->superframe_size) + return FFMIN(full_buf_size, s->frame_size); + return FFMIN(full_buf_size, s->superframe_size); }