[FFmpeg-devel] [PATCH] lavfi/zscale: fix tmp ptr alignment for zimg_filter_graph_process

Pavel Koshevoy pkoshevoy at gmail.com
Sat Nov 9 18:48:25 EET 2024


On Sat, Nov 9, 2024 at 9:43 AM James Almer <jamrial at gmail.com> wrote:

> On 11/9/2024 1:37 PM, Pavel Koshevoy wrote:
> > ---
> >   libavfilter/vf_zscale.c | 8 ++++++--
> >   1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
> > index 4ba059064b..87fe691cfd 100644
> > --- a/libavfilter/vf_zscale.c
> > +++ b/libavfilter/vf_zscale.c
> > @@ -750,7 +750,9 @@ static int filter_slice(AVFilterContext *ctx, void
> *data, int job_nr, int n_jobs
> >       }
> >       if (!s->graph[job_nr])
> >           return AVERROR(EINVAL);
> > -    ret = zimg_filter_graph_process(s->graph[job_nr], &src_buf,
> &dst_buf, s->tmp[job_nr], 0, 0, 0, 0);
> > +    ret = zimg_filter_graph_process(s->graph[job_nr], &src_buf,
> &dst_buf,
> > +                                    (uint8_t
> *)FFALIGN((uintptr_t)s->tmp[job_nr], ZIMG_ALIGNMENT),
>
> Does s->tmp[job_nr] have enough extra bytes for this?
>

probably no, I'll send another patch.


>
> > +                                    0, 0, 0, 0);
> >       if (ret)
> >           return print_zimg_error(ctx);
> >
> > @@ -765,7 +767,9 @@ static int filter_slice(AVFilterContext *ctx, void
> *data, int job_nr, int n_jobs
> >
> >           if (!s->alpha_graph[job_nr])
> >               return AVERROR(EINVAL);
> > -        ret = zimg_filter_graph_process(s->alpha_graph[job_nr],
> &src_buf, &dst_buf, s->tmp[job_nr], 0, 0, 0, 0);
> > +        ret = zimg_filter_graph_process(s->alpha_graph[job_nr],
> &src_buf, &dst_buf,
> > +                                        (uint8_t
> *)FFALIGN((uintptr_t)s->tmp[job_nr], ZIMG_ALIGNMENT),
> > +                                        0, 0, 0, 0);
> >           if (ret)
> >               return print_zimg_error(ctx);
> >       }
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list