From patchwork Fri Oct 16 10:46:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 23006 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 6DAB744BB63 for ; Fri, 16 Oct 2020 13:47:23 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5A52A68BA21; Fri, 16 Oct 2020 13:47:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-1.mx.upcmail.net (vie01a-dmta-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 79FC368BA16 for ; Fri, 16 Oct 2020 13:47:16 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1kTNGV-00070J-1g for ffmpeg-devel@ffmpeg.org; Fri, 16 Oct 2020 12:47:15 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id TNFWkQIE7Ir7GTNFWkAVqW; Fri, 16 Oct 2020 12:46:14 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=QN4WuTDL c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=UBRdXxVYTmb6ZtCkG9kA:9 a=1fhp2MxaeJtTNGEnv6mo:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=bWyr8ysk75zN3GCy5bjg:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 16 Oct 2020 12:46:12 +0200 Message-Id: <20201016104614.12474-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfPuqMcpJ42Cl7bRGmW6sFUf9m7fmK305ZXqxMO+m1OXpqKpQzU4IyXVE12sO2pAa8ufmJARxZ5eDTR63YsDPW0xMPXy9acvcqjqe+mFWBxppdVncPoTF MTmFgUUy38GxCLDfPETScw3K7/yVsENss67B1tK6tl5PbYd96WUR7X2H Subject: [FFmpeg-devel] [PATCH 1/3] avformat/av1dec: Fix padding in obu_get_packet() 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: stack buffer overflow (read) Fixes: 26369/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5721057325219840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/av1dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c index 10c4560968..395eef6522 100644 --- a/libavformat/av1dec.c +++ b/libavformat/av1dec.c @@ -382,7 +382,7 @@ static int obu_read_header(AVFormatContext *s) static int obu_get_packet(AVFormatContext *s, AVPacket *pkt) { ObuContext *c = s->priv_data; - uint8_t header[MAX_OBU_HEADER_SIZE]; + uint8_t header[MAX_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; int64_t obu_size; int size = av_fifo_space(c->fifo); int ret, len, type;