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 E0537407D8 for ; Sun, 24 Dec 2023 01:50:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 613D168D10E; Sun, 24 Dec 2023 03:49:59 +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 7E55568CF7A for ; Sun, 24 Dec 2023 03:49:52 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id AE92120002 for ; Sun, 24 Dec 2023 01:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703382591; 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=lw5MLFp0lG5EvzsstKZqByFrMPKoZsJe2B9/IonTSlw=; b=M7X1jtWcIKR91s3aS6wh2s+1l8uOf6AyM/mQFpfhCohqJvaMMJaMSksHgOJmfACVDoYzaq KLCEjQlM4bQ3yFhLIaE/o5urXJcfT8gYttueUkzeB8v+XvJve2WnRe4U/z3q7kfqCu6Rdz telSFZdnQQH9MARrUab8i+622MtwhBS6TVqixo4hH4hUJbnAoxjggfK3TvFRyFC3Tjr/am u4uJEoa9YUYMwtbbqtc7OyxijR30ThMOTeYjJWNBiFUPJAyDg1G89J6QDKhlI9tRkiLqy6 QWrPjd5EnfI9JjqkL3T+xK0fdWgK+e0rXCyBWTuDRYgIM/2/Qmb2QGvblpBSrw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 24 Dec 2023 02:49:49 +0100 Message-Id: <20231224014949.18449-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231224014949.18449-1-michael@niedermayer.cc> References: <20231224014949.18449-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/f_reverse: Apply PTS compensation only when pts is available 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/10753/poc16ffmpeg Regression since: 45dc668aea0edac34969b5a1ff76cf9ad3a09be1 Found-by: Zeng Yunxiang Signed-off-by: Michael Niedermayer --- libavfilter/f_reverse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_reverse.c b/libavfilter/f_reverse.c index 086819a207e..744f4a3cc83 100644 --- a/libavfilter/f_reverse.c +++ b/libavfilter/f_reverse.c @@ -266,7 +266,8 @@ static int areverse_request_frame(AVFilterLink *outlink) AVFrame *out = s->frames[s->nb_frames - 1]; out->duration = s->duration[s->flush_idx]; out->pts = s->pts[s->flush_idx++] - s->nb_samples; - s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples; + if (s->nb_frames > 1) + s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples; if (av_sample_fmt_is_planar(out->format)) reverse_samples_planar(out); -- 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".