On Wed, Apr 08, 2015 at 01:05:04PM +0200, Anton Khirnov wrote:
> Quoting Diego Biurrun (2015-04-08 12:57:09)
> > 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?
>
> I thought you'd know this by now -- you are not allowed to use the
> stdlib functions for allocating memory anywhere in libav.
Why would this apply to memory (locations) that will not be passed to
SIMD routines with certain alignment requirements later on?
> Here, you have to use av_realloc() and memset the memory manually.
I guess it's time to come up with av_reallocz().
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel