[FFmpeg-devel] [PATCH] dict.c: use av_mallocz instead of av_realloc

Michael Niedermayer michaelni at gmx.at
Tue Jan 29 20:53:16 CET 2013


On Tue, Jan 29, 2013 at 11:41:10AM +0000, Paweł Hajdan, Jr wrote:
> From: "Paweł Hajdan, Jr" <phajdan at google.com>
> 
> Memory passed to av_realloc must come from malloc,
> calloc or realloc, and not e.g. memalign. realloc(3):
> 
> The realloc() function changes the size of the memory block pointed to
> by ptr to size bytes. (...) Unless ptr is NULL, it must have been
> returned by an earlier call to malloc(), calloc() or realloc().
> 
> The issue has been found by debugallocation, a part of google-perftools:
> http://code.google.com/p/gperftools/ .
> 
> This makes fate pass when using LD_PRELOAD-ed debugallocation.
> 
> See also earlier discussion
> http://ffmpeg.org/pipermail/ffmpeg-devel/2013-January/137234.html
> 
> Signed-off-by: Paweł Hajdan, Jr <phajdan at google.com>
> ---
>  libavutil/dict.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

patch applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130129/5425d4ac/attachment.asc>


More information about the ffmpeg-devel mailing list