Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest
@ 2023-12-24 23:26 Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 2/4] avfilter/avf_showspectrum: fix off by 1 error Michael Niedermayer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Niedermayer @ 2023-12-24 23:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/af_stereowiden.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_stereowiden.c b/libavfilter/af_stereowiden.c
index f7a6a91ae40..1273c77116e 100644
--- a/libavfilter/af_stereowiden.c
+++ b/libavfilter/af_stereowiden.c
@@ -72,7 +72,7 @@ static int config_input(AVFilterLink *inlink)
     AVFilterContext *ctx = inlink->dst;
     StereoWidenContext *s = ctx->priv;
 
-    s->length = s->delay * inlink->sample_rate / 1000;
+    s->length = lrintf(s->delay * inlink->sample_rate / 1000);
     s->length *= 2;
     if (s->length == 0)
         return AVERROR(EINVAL);
-- 
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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 2/4] avfilter/avf_showspectrum: fix off by 1 error
  2023-12-24 23:26 [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
@ 2023-12-24 23:26 ` Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 3/4] avfilter/vf_gradfun: Do not overread last line Michael Niedermayer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Niedermayer @ 2023-12-24 23:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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

Regression since: 81df787b53eb5c6433731f6eaaf7f2a94d8a8c80

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 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 8cf73fce705..99a5c33d091 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1784,7 +1784,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;
-- 
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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 3/4] avfilter/vf_gradfun: Do not overread last line
  2023-12-24 23:26 [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 2/4] avfilter/avf_showspectrum: fix off by 1 error Michael Niedermayer
@ 2023-12-24 23:26 ` Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 4/4] avfilter/af_stereotools: round-up max size of buffer Michael Niedermayer
  2023-12-29  0:19 ` [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Niedermayer @ 2023-12-24 23:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

The code works in steps of 2 lines and lacks support for odd height
Implementing odd height support is better but for now this fixes the
out of array access

Fixes: out of array access
Fixes: tickets/10702/poc6ffmpe

Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_gradfun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c
index a71a68ecc16..e8d9cae8286 100644
--- a/libavfilter/vf_gradfun.c
+++ b/libavfilter/vf_gradfun.c
@@ -92,7 +92,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi
     for (y = 0; y < r; y++)
         ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2);
     for (;;) {
-        if (y < height - r) {
+        if (y + 1 < height - r) {
             int mod = ((y + r) / 2) % r;
             uint16_t *buf0 = buf + mod * bstride;
             uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride;
-- 
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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 4/4] avfilter/af_stereotools: round-up max size of buffer
  2023-12-24 23:26 [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 2/4] avfilter/avf_showspectrum: fix off by 1 error Michael Niedermayer
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 3/4] avfilter/vf_gradfun: Do not overread last line Michael Niedermayer
@ 2023-12-24 23:26 ` Michael Niedermayer
  2023-12-29  0:19 ` [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Niedermayer @ 2023-12-24 23:26 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Paul B Mahol

From: Paul B Mahol <onemda@gmail.com>

Fixes: out of array access
Fixes: tickets/10747/poc14ffmpeg

Found-by: Zeng Yunxiang and Song Jiaxuan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/af_stereotools.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c
index 4bcd696cf90..915edecc539 100644
--- a/libavfilter/af_stereotools.c
+++ b/libavfilter/af_stereotools.c
@@ -119,7 +119,7 @@ static int config_input(AVFilterLink *inlink)
     AVFilterContext *ctx = inlink->dst;
     StereoToolsContext *s = ctx->priv;
 
-    s->length = FFALIGN(inlink->sample_rate / 10, 2);
+    s->length = FFALIGN((inlink->sample_rate + 9) / 10, 2);
     if (!s->buffer)
         s->buffer = av_calloc(s->length, sizeof(*s->buffer));
     if (!s->buffer)
-- 
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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest
  2023-12-24 23:26 [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
                   ` (2 preceding siblings ...)
  2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 4/4] avfilter/af_stereotools: round-up max size of buffer Michael Niedermayer
@ 2023-12-29  0:19 ` Michael Niedermayer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Niedermayer @ 2023-12-29  0:19 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 529 bytes --]

On Mon, Dec 25, 2023 at 12:26:21AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/af_stereowiden.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-29  0:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-24 23:26 [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer
2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 2/4] avfilter/avf_showspectrum: fix off by 1 error Michael Niedermayer
2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 3/4] avfilter/vf_gradfun: Do not overread last line Michael Niedermayer
2023-12-24 23:26 ` [FFmpeg-devel] [PATCH 4/4] avfilter/af_stereotools: round-up max size of buffer Michael Niedermayer
2023-12-29  0:19 ` [FFmpeg-devel] [PATCH 1/4] avfilter/af_stereowiden: Round length to nearest Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git