On Tue, Apr 07, 2015 at 08:41:19PM +0200, Anton Khirnov wrote:
> Quoting Diego Biurrun (2015-04-07 17:55:19)
> > On Sun, Apr 05, 2015 at 09:04:09AM +0200, Anton Khirnov wrote:
> > > Quoting Diego Biurrun (2015-03-31 16:31:33)
> > > > +unsigned ff_els_decode_unsigned(ElsDecCtx *ctx, ElsUnsignedRung *ur)
> > > > +{
> > > > +    int i, n, r, bit;
> > > > +    ElsRungNode *rung_node;
> > > > +
> > > > +    if (ctx->err)
> > > > +        return 0;
> > > > +
> > > > +    /* decode unary prefix */
> > > > +    for (n = 0; n < ELS_EXPGOLOMB_LEN + 1; n++)
> > > > +        if (ff_els_decode_bit(ctx, &ur->prefix_rung[n]))
> > > > +            break;
> > > > +
> > > > +    /* handle the error/overflow case */
> > > > +    if (ctx->err || n >= ELS_EXPGOLOMB_LEN) {
> > > > +        ctx->err = AVERROR(EOVERFLOW);
> > > > +        return 0;
> > > > +    }
> > > > +
> > > > +    /* handle the zero case */
> > > > +    if (!n)
> > > > +        return 0;
> > > > +
> > > > +    /* initialize probability tree */
> > > > +    if (!ur->rem_rung_list) {
> > > > +        ur->rem_rung_list = av_mallocz(RUNG_SPACE);
> > > 
> > > This variable mixes malloc and realloc, that should not be done.
> > 
> > I switched it to get allocated by plain calloc().
> 
> eh...calloc?

What else do you want to use for zeroed memory instead of av_mallocz?

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

Reply via email to