[FFmpeg-devel] [PATCH 4/5] avutil/lfg: Correct index type to avoid undefined behavior

Michael Niedermayer michael at niedermayer.cc
Sun Oct 20 00:15:30 EEST 2019


On Sat, Oct 19, 2019 at 05:45:04PM -0300, James Almer wrote:
> On 10/19/2019 5:39 PM, Michael Niedermayer wrote:
> > Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
> > Fixes: 18333/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COMFORTNOISE_fuzzer-5668481831272448
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavutil/lfg.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/lfg.h b/libavutil/lfg.h
> > index 03f779ad8a..8b18df2cea 100644
> > --- a/libavutil/lfg.h
> > +++ b/libavutil/lfg.h
> > @@ -26,7 +26,7 @@
> >  
> >  typedef struct AVLFG {
> >      unsigned int state[64];
> > -    int index;
> > +    unsigned index;
> >  } AVLFG;
> 
> Wouldn't this be considered an API change?

is index public API ?
anyway i can fix this without changing the struct
maybe thats safer

will do that

thanks

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

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191019/054a53a1/attachment.sig>


More information about the ffmpeg-devel mailing list