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 BBF14454DE for ; Sat, 30 Dec 2023 02:49:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DD1C768CCB5; Sat, 30 Dec 2023 04:49:17 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3EF4668CC33 for ; Sat, 30 Dec 2023 04:49:11 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4991520003 for ; Sat, 30 Dec 2023 02:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703904550; 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=+kfA/FMdj6Qdai/8rCzeedqUH20z6n6/oEq0hBPHUJ8=; b=LVli3o+5VuA4RHuYoteXneBefSS3y793sTtgDOOz2mALQLUy6WJlNH4rXBjRaIKgmB/dzd RJIan4we34fffUUKRQzomRPtNoDjPQeLzVLG9VpNacGNYxVmvedbd6xZ956bPntCi16xfy h2Sx3TNrmJFtVE8UF55loOG8Ppf3LEBR8/ncHiVblXNqGM62WIwxKL4fZxu3sn7c9x5fpd jMAC5I//6ed5EJAehRu7aPPLFdRFc6DDcz7As+JUtSiK1dV8vlGATfBkilTAfsM3JKmLKE NT6gYuVjiIyx5kxSOjzE8ephF6hgUkqglMzSTGOo+mi19E3pPyMUqIy6nZfLbw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 30 Dec 2023 03:49:04 +0100 Message-Id: <20231230024905.17121-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231230024905.17121-1-michael@niedermayer.cc> References: <20231230024905.17121-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/mpegvideo_enc: Dont copy beyond the image 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: out of array access Fixes: tickets/10754/poc17ffmpeg Discovered by Zeng Yunxiang. Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index dcbf4c0429c..b369c3c735d 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1212,7 +1212,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) dst += INPLACE_OFFSET; if (src_stride == dst_stride) - memcpy(dst, src, src_stride * h); + memcpy(dst, src, src_stride * h - src_stride + w); else { int h2 = h; uint8_t *dst2 = dst; -- 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".