[FFmpeg-devel] [PATCH 3/6] avcodec/rv60dec: Use get_bits_long()

Michael Niedermayer michael at niedermayer.cc
Tue Dec 24 03:57:03 EET 2024


Hi Peter

On Sun, Dec 08, 2024 at 06:29:58PM +1100, Peter Ross wrote:
> On Sun, Dec 08, 2024 at 04:57:00AM +0100, Michael Niedermayer wrote:
> > Fixes: 378634700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5008344043028480
> > Fixes: assertion failure
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/rv60dec.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
> > index 449650223d8..4cc71dcd6ee 100644
> > --- a/libavcodec/rv60dec.c
> > +++ b/libavcodec/rv60dec.c
> > @@ -395,10 +395,13 @@ static int read_slice_sizes(RV60Context *s, GetBitContext *gb)
> >      for (int i = 0; i < s->cu_height; i++)
> >          s->slice[i].sign = get_bits1(gb);
> >  
> > -    s->slice[0].size = last_size = sum = get_bits(gb, nbits);
> > +    s->slice[0].size = last_size = sum = get_bits_long(gb, nbits);
> > +
> > +    if (sum < 0)
> > +        return AVERROR_INVALIDDATA;
> >  
> >      for (int i = 1; i < s->cu_height; i++) {
> > -        int diff = get_bits(gb, nbits);
> > +        int diff = get_bits_long(gb, nbits);
> >          if (s->slice[i].sign)
> >              last_size += diff;
> >          else
> 
> please apply

will apply

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- 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/20241224/79f75aba/attachment.sig>


More information about the ffmpeg-devel mailing list