[FFmpeg-cvslog] avfilter/avf_showspectrum: fix off by 1 error

Michael Niedermayer git at videolan.org
Sun Apr 14 20:33:40 EEST 2024


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun Dec 24 20:31:02 2023 +0100| [8711cea3841fc385cccb1e7255176479e865cd4d] | committer: Michael Niedermayer

avfilter/avf_showspectrum: fix off by 1 error

Fixes: out of array access
Fixes: tickets/10749/poc15ffmpeg

Regression since: 81df787b53eb5c6433731f6eaaf7f2a94d8a8c80

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit ab0fdaedd1e7224f7e84ea22fcbfaa4ca75a6c06)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8711cea3841fc385cccb1e7255176479e865cd4d
---

 libavfilter/avf_showspectrum.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index b111471116..b931f52a2b 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1779,7 +1779,7 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
             int acc_samples = 0;
             int dst_offset = 0;
 
-            while (nb_frame <= s->nb_frames) {
+            while (nb_frame < s->nb_frames) {
                 AVFrame *cur_frame = s->frames[nb_frame];
                 int cur_frame_samples = cur_frame->nb_samples;
                 int nb_samples = 0;



More information about the ffmpeg-cvslog mailing list