Hi,

2014-02-10 6:42 GMT+01:00 Kostya Shishkov <[email protected]>:
> On Sun, Feb 09, 2014 at 11:21:33PM +0100, Christophe Gisquet wrote:
>> +            if(s->cdlms[c][i].order & 8) {
>> +                static int warned;
>> +                if(!warned)
>> +                    avpriv_request_sample(s->avctx, "CDLMS of order %d",
>> +                                          s->cdlms[c][i].order);
>> +                warned = 1;
>> +            }
>
> & 7 maybe ?

You can't see that in the diff, but just above, we have:
s->cdlms[c][i].order = (get_bits(&s->gb, 7) + 1) * 8;

What you suggest is still valid, and would catch things even if they
changed, though.

>> +        for (i = 0; i < s->cdlms_ttl[c]; i++) {
>> +            memset(s->cdlms[c][i].coefs + s->cdlms[c][i].order, 0,
>> +                   (s->cdlms[c][i].order & (WMALL_COEFF_PAD_SIZE-1))
>
> wouldn't that be too much on large orders (e.g. order = 15)?
> I'd simply zero to the end of coefs array.

Hum right, these lines are wrong on so many levels... Strange it
didn't trigger any crash, actually.

Seeing the conditions for this to trigger, I'm tempted then to just write:
        // pad the coeff buffers with 0s up to a 16-aligned position
        for (i = 0; i < s->cdlms_ttl[c]; i++)
            if(s->cdlms[c][i].order & 8)
                AV_ZERO128(s->cdlms[c][i].coefs + s->cdlms[c][i].order);


That's the problem when there's no sample that may trigger it (except
crafted ones).

-- 
Christophe
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to