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/6] avfilter/vf_tiltandshift: Free dst on error
@ 2024-07-10 22:50 Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL check Michael Niedermayer
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1559901 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_tiltandshift.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_tiltandshift.c b/libavfilter/vf_tiltandshift.c
index b49a713339d..08bcb062473 100644
--- a/libavfilter/vf_tiltandshift.c
+++ b/libavfilter/vf_tiltandshift.c
@@ -237,8 +237,10 @@ static int output_frame(AVFilterLink *outlink)
 
     // set correct timestamps and props as long as there is proper input
     ret = av_frame_copy_props(dst, s->input);
-    if (ret < 0)
+    if (ret < 0) {
+        av_frame_free(&dst);
         return ret;
+    }
 
     // discard frame at the top of the list since it has been fully processed
     list_remove_head(s);
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL check
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
@ 2024-07-10 22:50 ` Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL Michael Niedermayer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1437472 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_tonemap_opencl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c
index a2a27307b48..03219857d46 100644
--- a/libavfilter/vf_tonemap_opencl.c
+++ b/libavfilter/vf_tonemap_opencl.c
@@ -343,8 +343,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
     int err;
     double peak = ctx->peak;
 
-    AVHWFramesContext *input_frames_ctx =
-        (AVHWFramesContext*)input->hw_frames_ctx->data;
+    AVHWFramesContext *input_frames_ctx;
 
     av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
            av_get_pix_fmt_name(input->format),
@@ -352,6 +351,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
 
     if (!input->hw_frames_ctx)
         return AVERROR(EINVAL);
+    input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data;
 
     output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     if (!output) {
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL check Michael Niedermayer
@ 2024-07-10 22:50 ` Michael Niedermayer
  2024-08-11 10:42   ` Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 4/6] avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES Michael Niedermayer
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

untested

Fixes: CID1440836 Dereference after null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_tpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c
index 72d0bf338fe..a230a50022c 100644
--- a/libavfilter/vf_tpad.c
+++ b/libavfilter/vf_tpad.c
@@ -132,6 +132,7 @@ static int activate(AVFilterContext *ctx)
             s->cache_start = ff_inlink_peek_frame(inlink, 0);
         } else if (!s->cache_start) {
             FF_FILTER_FORWARD_WANTED(outlink, inlink);
+            return FFERROR_NOT_READY;
         }
         frame = av_frame_clone(s->cache_start);
         if (!frame)
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* [FFmpeg-devel] [PATCH 4/6] avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL check Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL Michael Niedermayer
@ 2024-07-10 22:50 ` Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 5/6] avfilter/vf_v360: Assert that vf was initialized Michael Niedermayer
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Related: CID1423281 Out-of-bounds read

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

diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c
index 09398464ca3..1b7cbde9fdb 100644
--- a/libavfilter/vf_unsharp_opencl.c
+++ b/libavfilter/vf_unsharp_opencl.c
@@ -59,7 +59,7 @@ typedef struct UnsharpOpenCLContext {
         cl_int   size_y;
         cl_float amount;
         cl_float threshold;
-    } plane[4];
+    } plane[AV_VIDEO_MAX_PLANES];
 } UnsharpOpenCLContext;
 
 
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* [FFmpeg-devel] [PATCH 5/6] avfilter/vf_v360: Assert that vf was initialized
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
                   ` (2 preceding siblings ...)
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 4/6] avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES Michael Niedermayer
@ 2024-07-10 22:50 ` Michael Niedermayer
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 6/6] avfilter/vf_xfade: Compute w2, h2 with float Michael Niedermayer
  2024-07-11 22:19 ` [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Vittorio Giovara
  5 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Maybe helps: CID1504571 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_v360.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 299dbe9ff54..9a6c31228d3 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -3789,6 +3789,8 @@ static int barrelsplit_to_xyz(const V360Context *s,
         case 3: // back bottom
             vf = (y * 2.f - 1.5f) / scaleh + 3.f - facef;
             break;
+        default:
+            av_assert0(0);
         }
         l_x = (0.5f - uf) / scalew;
         l_y =  0.5f * dir_vert;
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* [FFmpeg-devel] [PATCH 6/6] avfilter/vf_xfade: Compute w2, h2 with float
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
                   ` (3 preceding siblings ...)
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 5/6] avfilter/vf_v360: Assert that vf was initialized Michael Niedermayer
@ 2024-07-10 22:50 ` Michael Niedermayer
  2024-07-11 22:19 ` [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Vittorio Giovara
  5 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-10 22:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1458148 Result is not floating-point
Fixes: CID1458149 Result is not floating-point
Fixes: CID1458150 Result is not floating-point
Fixes: CID1458151 Result is not floating-point
Fixes: CID1458152 Result is not floating-point
Fixes: CID1458154 Result is not floating-point
Fixes: CID1458155 Result is not floating-point
Fixes: CID1458156 Result is not floating-point

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_xfade.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index 4eea761dac6..e67a917d14f 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -956,7 +956,7 @@ static void vertopen##name##_transition(AVFilterContext *ctx,
 {                                                                                    \
     XFadeContext *s = ctx->priv;                                                     \
     const int width = out->width;                                                    \
-    const float w2 = out->width / 2;                                                 \
+    const float w2 = out->width / 2.0;                                                 \
                                                                                      \
     for (int y = slice_start; y < slice_end; y++) {                                  \
         for (int x = 0; x < width; x++) {                                            \
@@ -984,7 +984,7 @@ static void vertclose##name##_transition(AVFilterContext *ctx,
     XFadeContext *s = ctx->priv;                                                     \
     const int nb_planes = s->nb_planes;                                              \
     const int width = out->width;                                                    \
-    const float w2 = out->width / 2;                                                 \
+    const float w2 = out->width / 2.0;                                                 \
                                                                                      \
     for (int y = slice_start; y < slice_end; y++) {                                  \
         for (int x = 0; x < width; x++) {                                            \
@@ -1012,7 +1012,7 @@ static void horzopen##name##_transition(AVFilterContext *ctx,
     XFadeContext *s = ctx->priv;                                                     \
     const int nb_planes = s->nb_planes;                                              \
     const int width = out->width;                                                    \
-    const float h2 = out->height / 2;                                                \
+    const float h2 = out->height / 2.0;                                                \
                                                                                      \
     for (int y = slice_start; y < slice_end; y++) {                                  \
         const float smooth = 2.f - fabsf((y - h2) / h2) - progress * 2.f;            \
@@ -1040,7 +1040,7 @@ static void horzclose##name##_transition(AVFilterContext *ctx,
     XFadeContext *s = ctx->priv;                                                     \
     const int nb_planes = s->nb_planes;                                              \
     const int width = out->width;                                                    \
-    const float h2 = out->height / 2;                                                \
+    const float h2 = out->height / 2.0;                                                \
                                                                                      \
     for (int y = slice_start; y < slice_end; y++) {                                  \
         const float smooth = 1.f + fabsf((y - h2) / h2) - progress * 2.f;            \
-- 
2.45.2

_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error
  2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
                   ` (4 preceding siblings ...)
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 6/6] avfilter/vf_xfade: Compute w2, h2 with float Michael Niedermayer
@ 2024-07-11 22:19 ` Vittorio Giovara
  2024-07-12 19:59   ` Michael Niedermayer
  5 siblings, 1 reply; 9+ messages in thread
From: Vittorio Giovara @ 2024-07-11 22:19 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, Jul 11, 2024 at 12:50 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> Fixes: CID1559901 Resource leak
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_tiltandshift.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_tiltandshift.c b/libavfilter/vf_tiltandshift.c
> index b49a713339d..08bcb062473 100644
> --- a/libavfilter/vf_tiltandshift.c
> +++ b/libavfilter/vf_tiltandshift.c
> @@ -237,8 +237,10 @@ static int output_frame(AVFilterLink *outlink)
>
>      // set correct timestamps and props as long as there is proper input
>      ret = av_frame_copy_props(dst, s->input);
> -    if (ret < 0)
> +    if (ret < 0) {
> +        av_frame_free(&dst);
>          return ret;
> +    }
>
>      // discard frame at the top of the list since it has been fully
> processed
>      list_remove_head(s);
> --
>

lgtm
-- 
Vittorio
_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error
  2024-07-11 22:19 ` [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Vittorio Giovara
@ 2024-07-12 19:59   ` Michael Niedermayer
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-07-12 19:59 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


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

On Fri, Jul 12, 2024 at 12:19:29AM +0200, Vittorio Giovara wrote:
> On Thu, Jul 11, 2024 at 12:50 AM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
> 
> > Fixes: CID1559901 Resource leak
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavfilter/vf_tiltandshift.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/vf_tiltandshift.c b/libavfilter/vf_tiltandshift.c
> > index b49a713339d..08bcb062473 100644
> > --- a/libavfilter/vf_tiltandshift.c
> > +++ b/libavfilter/vf_tiltandshift.c
> > @@ -237,8 +237,10 @@ static int output_frame(AVFilterLink *outlink)
> >
> >      // set correct timestamps and props as long as there is proper input
> >      ret = av_frame_copy_props(dst, s->input);
> > -    if (ret < 0)
> > +    if (ret < 0) {
> > +        av_frame_free(&dst);
> >          return ret;
> > +    }
> >
> >      // discard frame at the top of the list since it has been fully
> > processed
> >      list_remove_head(s);
> > --
> >
> 
> lgtm

will apply

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2


[-- 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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL
  2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL Michael Niedermayer
@ 2024-08-11 10:42   ` Michael Niedermayer
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Niedermayer @ 2024-08-11 10:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


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

On Thu, Jul 11, 2024 at 12:50:09AM +0200, Michael Niedermayer wrote:
> untested
> 
> Fixes: CID1440836 Dereference after null check

will apply patchset except this


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

No snowflake in an avalanche ever feels responsible. -- Voltaire

[-- 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] 9+ messages in thread

end of thread, other threads:[~2024-08-11 10:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-10 22:50 [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Michael Niedermayer
2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL check Michael Niedermayer
2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 3/6] avfilter/vf_tpad: Dont clone NULL Michael Niedermayer
2024-08-11 10:42   ` Michael Niedermayer
2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 4/6] avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES Michael Niedermayer
2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 5/6] avfilter/vf_v360: Assert that vf was initialized Michael Niedermayer
2024-07-10 22:50 ` [FFmpeg-devel] [PATCH 6/6] avfilter/vf_xfade: Compute w2, h2 with float Michael Niedermayer
2024-07-11 22:19 ` [FFmpeg-devel] [PATCH 1/6] avfilter/vf_tiltandshift: Free dst on error Vittorio Giovara
2024-07-12 19:59   ` 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