Janne Grunau <[email protected]> writes: > On 2012-01-31 11:40:11 -0500, Justin Ruggles wrote: >> From: Reimar Döffinger <[email protected]> >> >> 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 > > This feels too hacky and sounds if it's just used to silence "depends > on uninitilized value" valgrind warnings.
Indeed, and this is the wrong way to "fix" such things. [...] >> /** >> + * Same behaviour av_fast_malloc but the buffer has additional >> + * FF_INPUT_PADDING_SIZE at the end which will will always be 0. >> + * >> + * In addition the whole buffer will initially and after resizes > > also only after buffer growth > >> + * be 0-initialized so that no uninitialized data will ever appear. > > the old data which is preserved after a buffer shrink could be also > considered uninitialized data. Not only could, it should. This patch should not be accepted without a better understanding of what problem, if any, it is intended to solve. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
