From patchwork Wed Jul 31 08:52:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 14169 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5088D449F9D for ; Wed, 31 Jul 2019 11:54:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 402F068A737; Wed, 31 Jul 2019 11:54:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-1.mx.upcmail.net (vie01a-dmta-pe08-1.mx.upcmail.net [84.116.36.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8ED2368A38B for ; Wed, 31 Jul 2019 11:54:05 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1hskN3-0004LP-0i for ffmpeg-devel@ffmpeg.org; Wed, 31 Jul 2019 10:54:05 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id skM4heTAE5D5NskM4hXpQe; Wed, 31 Jul 2019 10:53:05 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=bu8y+3Si c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=hcnHL5KfeWmfr-6SCyMA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 31 Jul 2019 10:52:33 +0200 Message-Id: <20190731085234.26529-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731085234.26529-1-michael@niedermayer.cc> References: <20190731085234.26529-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfBT4OpBedaPLGVp4HU55UPpnjJKoTAd8vVuz+B9Y9gH993uEVwOzBi/dLLuFj0qZ4X7XVUCXxNxmQ/6/YiiC9B5n4zKBjpEurm7eq9dU0WiLlDkmprMy Ock5epoWRY1zPbOKH1JXIkX/2nBdk6XfYMz5i51ww0fzEUqTQ8uVDtEj Subject: [FFmpeg-devel] [PATCH 2/3] tools/target_dec_fuzzer: Assert that max pixels is not violated 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- tools/target_dec_fuzzer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 0c398da95b..a3c735e339 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -259,6 +259,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { av_frame_unref(frame); int ret = decode_handler(ctx, frame, &got_frame, &avpkt); + av_assert0(ctx->width * ctx->height <= maxpixels_per_frame); + ec_pixels += ctx->width * ctx->height; if (it > 20 || ec_pixels > 4 * ctx->max_pixels) ctx->error_concealment = 0;