[FFmpeg-devel] [PATCH 1/4] avfilter/af_pan: Fix sscanf() use
Michael Niedermayer
michael at niedermayer.cc
Tue Jan 7 14:45:52 EET 2025
Hi Nicolas
On Tue, Jan 07, 2025 at 10:52:17AM +0100, Nicolas George wrote:
> Michael Niedermayer (12025-01-07):
> > Fixes: Memory Data Leak
> >
> > Found-by: Simcha Kosman <simcha.kosman at cyberark.com>
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> > libavfilter/af_pan.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
> > index 0d20b0307b3..3a11a7d324f 100644
> > --- a/libavfilter/af_pan.c
> > +++ b/libavfilter/af_pan.c
> > @@ -196,7 +196,7 @@ static av_cold int init(AVFilterContext *ctx)
> > sign = 1;
> > while (1) {
> > gain = 1;
>
> > - if (sscanf(arg, "%lf%n *%n", &gain, &len, &len))
> > + if (sscanf(arg, "%lf%n *%n", &gain, &len, &len) == 1)
>
> IIRC, there are implementations out there that do not respect the
> specification that %n does not increment the conversion count returned
> by the function. I suppose the issue was a negative return value? If so,
> please use >= 1 instead of == 1.
yes it was a negative return
will apply with your suggested change
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250107/f9d3dbc5/attachment.sig>
More information about the ffmpeg-devel
mailing list