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 4BEF549631 for ; Sat, 16 Mar 2024 21:26:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9F1ED68D16D; Sat, 16 Mar 2024 23:26:48 +0200 (EET) 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 3251268D06F for ; Sat, 16 Mar 2024 23:26:39 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 72B2BE0002 for ; Sat, 16 Mar 2024 21:26:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1710624398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=qVdj01amQCVLEApEOtmHp65ovvkNpbaKvD/L3NN0JRM=; b=VPiBylknRYax46rTPtR1Pqr1jEkiPERlhkSV+9j/f5JE7eDhDAN+bCW6owLvIL3wwVQhLt RChYrslxQuel7nMO6qLEgEhGLlPFo7vzeNriAxFkxoum1Dou89gDIEtd5dQq8Ja6KIE+5N uF90YKyG1B0kEL5Z1EwTmatN/ljPX+KP2G3DsZlkuGL7Y6QZ9dd6rNefW3ojRqFVdWgXJ1 eqJAyxEVdHTDLh91RCd7P76T+X1EiE3SXW3zSLdY3NO1cN5IpPRLCInabzPwX+7x45mR6r qZAIxnvFvxVOW3OBOdryHbUckQfZ1EDZpfEHXdRmFpshdh2gfi5FuYWucZFqnw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 16 Mar 2024 22:26:35 +0100 Message-Id: <20240316212636.2642-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240316212636.2642-1-michael@niedermayer.cc> References: <20240316212636.2642-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/iff: dont add into unused pointers 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: overflowing pointers Fixes: 66444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-4812862400823296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/iff.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index faf4e21c42..dcca7018c4 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -1661,7 +1661,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, uint8_t *row = &frame->data[0][y * frame->linesize[0]]; memset(row, 0, avctx->width); for (plane = 0; plane < s->bpp; plane++) { - buf += decode_byterun(s->planebuf, s->planesize, gb); + decode_byterun(s->planebuf, s->planesize, gb); if (avctx->codec_tag == MKTAG('A', 'N', 'I', 'M')) { memcpy(video, s->planebuf, s->planesize); video += s->planesize; @@ -1674,7 +1674,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, uint8_t *row = &frame->data[0][y * frame->linesize[0]]; memset(s->mask_buf, 0, avctx->width * sizeof(uint32_t)); for (plane = 0; plane < s->bpp; plane++) { - buf += decode_byterun(s->planebuf, s->planesize, gb); + decode_byterun(s->planebuf, s->planesize, gb); decodeplane32(s->mask_buf, s->planebuf, s->planesize, plane); } lookup_pal_indicies((uint32_t *)row, s->mask_buf, s->mask_palbuf, avctx->width); @@ -1685,7 +1685,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, uint8_t *row = &frame->data[0][y * frame->linesize[0]]; memset(s->ham_buf, 0, s->planesize * 8); for (plane = 0; plane < s->bpp; plane++) { - buf += decode_byterun(s->planebuf, s->planesize, gb); + decode_byterun(s->planebuf, s->planesize, gb); if (avctx->codec_tag == MKTAG('A', 'N', 'I', 'M')) { memcpy(video, s->planebuf, s->planesize); video += s->planesize; @@ -1699,7 +1699,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, uint8_t *row = &frame->data[0][y * frame->linesize[0]]; memset(row, 0, avctx->width << 2); for (plane = 0; plane < s->bpp; plane++) { - buf += decode_byterun(s->planebuf, s->planesize, gb); + decode_byterun(s->planebuf, s->planesize, gb); decodeplane32((uint32_t *)row, s->planebuf, s->planesize, plane); } } @@ -1708,12 +1708,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { for (y = 0; y < avctx->height; y++) { uint8_t *row = &frame->data[0][y * frame->linesize[0]]; - buf += decode_byterun(row, avctx->width, gb); + decode_byterun(row, avctx->width, gb); } } else if (s->ham) { // IFF-PBM: HAM to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height; y++) { uint8_t *row = &frame->data[0][y * frame->linesize[0]]; - buf += decode_byterun(s->ham_buf, avctx->width, gb); + decode_byterun(s->ham_buf, avctx->width, gb); decode_ham_plane32((uint32_t *)row, s->ham_buf, s->ham_palbuf, s->planesize); } } else -- 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".