[FFmpeg-devel] [PATCH 3/7] avcodec/bonk: Remove special 32bit case from read_uint_max()

Paul B Mahol onemda at gmail.com
Mon Nov 14 22:58:24 EET 2022


On 11/14/22, Michael Niedermayer <michael at niedermayer.cc> wrote:
> On Sun, Nov 06, 2022 at 07:28:48PM +0100, Paul B Mahol wrote:
>> On 11/6/22, Michael Niedermayer <michael at niedermayer.cc> wrote:
>> > This case seems not to match the reference decoder and it also
>> > seems not reachable
>> >
>> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>> > ---
>> >  libavcodec/bonk.c | 3 +--
>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> > diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
>> > index 04ea4def2f..fca8c246aa 100644
>> > --- a/libavcodec/bonk.c
>> > +++ b/libavcodec/bonk.c
>> > @@ -136,8 +136,7 @@ static unsigned read_uint_max(BonkContext *s,
>> > uint32_t
>> > max)
>> >      if (max == 0)
>> >          return 0;
>> >
>> > -    if (max >> 31)
>> > -        return 32;
>> > +    av_assert0(max >> 31 == 0);
>> >
>> >      for (unsigned i = 1; i <= max - value; i+=i)
>> >          if (get_bits1(&s->gb))
>> > --
>> > 2.17.1
>>
>>
>> Not sure, at your risk.
>>
>> Test lossy mode too.
>
> piotr provided me with a larger testset including lossy files
> they are all unchanged
>
> will apply this and the other remaining patches.
> They look all correct to me, if i am wrong which is always a possibility
> iam human ... then you can revert whats wrong of course
>

Its not for valid, but for fuzzed files.

> thx
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If you drop bombs on a foreign country and kill a hundred thousand
> innocent people, expect your government to call the consequence
> "unprovoked inhuman terrorist attacks" and use it to justify dropping
> more bombs and killing more people. The technology changed, the idea is
> old.
>


More information about the ffmpeg-devel mailing list