From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A7F23457DA for ; Sun, 23 Apr 2023 22:33:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 48CA268BF88; Mon, 24 Apr 2023 01:32:50 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8152268BF75 for ; Mon, 24 Apr 2023 01:32:42 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id CF5FFE0003 for ; Sun, 23 Apr 2023 22:32:41 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 24 Apr 2023 00:32:35 +0200 Message-Id: <20230423223236.375-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230423223236.375-1-michael@niedermayer.cc> References: <20230423223236.375-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/cavsdec: Check bits left before picture allocation 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: Timeout Fixes: 57893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5091726540013568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cavsdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index b1fa9a981d..37071dfbc7 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1020,6 +1020,9 @@ static int decode_pic(AVSContext *h) skip_bits(&h->gb, 1); //marker_bit } + if (get_bits_left(&h->gb) < 23) + return AVERROR_INVALIDDATA; + ret = ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ? 0 : AV_GET_BUFFER_FLAG_REF); if (ret < 0) -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".