From patchwork Mon Sep 18 22:35:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43770 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a886:b0:149:dfde:5c0a with SMTP id ca6csp136202pzb; Mon, 18 Sep 2023 15:36:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKD03FrYwCy/xBC4Yct4EbPgurpyiY5w8ArblEDO+TrCa0UbVVrnu2EpchQoG78OzCJgg2 X-Received: by 2002:a17:906:cc4a:b0:9a2:ecd:d963 with SMTP id mm10-20020a170906cc4a00b009a20ecdd963mr7930576ejb.44.1695076574172; Mon, 18 Sep 2023 15:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695076574; cv=none; d=google.com; s=arc-20160816; b=HriLMm4r/Xdv/vcMDI9gipB6o/cUMdraMllEVFygXk80ap/TfQpW1B/xWTZoDlAWh0 16bILuWTvnX8jxJUi4j/CEcLWUlavZI2WXhe40N+hC5hkkYKTd5dz/4TlW2nn+Bd6016 8cQ4obaG9SFEUFhUoJc2e/W5LyLXCQEjFhgQIhraZnRknAdS+4vdxdu9l0IIGyDBT35I LbcWXd0pzjjh5VwyjXuJrnvII/10YAaugcWUvJRHodEdi2FETBCt3Nbn3xXn7mW0kFxc V2VMhbyzuOLTCrlAQjIjhXCBz5jzP67IREov0medES+U8vimnH666DdxNTjI81Y36mg2 cBfg== 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; bh=cQaBnEkjFgChdlegwQ3uN3H62Ouf6lZzuGuKRHeF8Rk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=xYmgeZAAMTLIObFrM46RRAvfTy+71/rCVvQFMuaK3KtsKfldAaO1IRzInhLQDSECRG duQKSsiGUzuSq1GxBXnzZV3sIFZhslYwFHhWanteOtSXoxR03xw7d1Lftt0RqUlC/LP9 FjUGaMY/f2TvAc+maSt7Bz99XETk7C6rhlMOgV6jUMSGYS6j6B/1p6qKooFDh3yBwhZY QWiYQrSYHcecmmOEZeip2NNROGhWyWvOvbCRvYkkCribbZa03T5efF8xiSuGD/g/Z/Qt 6cljQaG/GFQjOEmSFV1+qV3DdwUgKFtVovTiQ2QB5rwz2jDHYHGexlSjXZK2Q0oLdsS3 HsPA== 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 c10-20020a170906924a00b0099e09f0a544si8899159ejx.871.2023.09.18.15.36.13; Mon, 18 Sep 2023 15:36:14 -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 071BB68C8B0; Tue, 19 Sep 2023 01:35:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1432468C2FB for ; Tue, 19 Sep 2023 01:35:39 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 451D11BF207 for ; Mon, 18 Sep 2023 22:35:38 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 19 Sep 2023 00:35:33 +0200 Message-Id: <20230918223534.23567-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230918223534.23567-1-michael@niedermayer.cc> References: <20230918223534.23567-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/escape124: Do not return random numbers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: LJgFYHLd3XY2 Fixes: out of array access Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-6035022714634240 Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-6422176201572352 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/escape124.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index cd62f8d1f04..357320ef94f 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -234,7 +234,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = av_frame_ref(frame, s->frame)) < 0) return ret; - return frame_size; + return 0; } for (i = 0; i < 3; i++) { @@ -367,7 +367,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, *got_frame = 1; - return frame_size; + return 0; }