[FFmpeg-devel] [PATCH] Add and use av_fast_padded_malloc.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jan 17 20:22:16 CET 2012


On Tue, Jan 17, 2012 at 08:08:48AM +0100, Reimar Döffinger wrote:
> On Tue, Jan 17, 2012 at 04:26:43AM +0100, Michael Niedermayer wrote:
> > On Tue, Jan 17, 2012 at 12:18:17AM +0100, Reimar Döffinger wrote:
> > > The same as av_fast_malloc but uses av_mallocz and keeps extra
> > > always-0 padding.
> > > This does not mean the memory will be 0-initialized after each call,
> > > but actually only after each growth of the buffer.
> > > However this makes sure that
> > > a) all data anywhere in the buffer is always initialized
> > > b) the padding is always 0
> > > c) the user does not have to bother with adding the padding themselves
> > > Fixes another valgrind warning about use of uninitialized data,
> > > this time with fate-vsynth1-jpegls.
> > > 
> > > Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> > 
> > LGTM
> 
> I wonder if it would be better to make the size of the padding an
> argument.

Pushed, I found enough cases where it makes sense as it is
to override my doubts.


More information about the ffmpeg-devel mailing list