[FFmpeg-devel] [PATCH v5] lavf/matroskadec: Normalize noncompliant A_QUICKTIME/V_QUICKTIME private data

Michael Niedermayer michael at niedermayer.cc
Mon Jan 11 01:46:43 CET 2016


On Sun, Jan 10, 2016 at 04:04:47AM +0100, Mats Peterson wrote:
> How about this one, Michael? Rather than using the obviously
> dangerous av_realloc() it uses av_malloc() to allocate new memory
> for the private data, then copies the private data to it, frees the
> pointer to the original private data, and finally sets
> track->codec->priv_data to the newly allocated memory.

that documentation is misleading, av_malloc() is if one is really
pedantic not safe to be passed to av_free or av_realloc()
if one isnt pedantic it safe to be passed to both

but of course theres nothing wrong with seperating them if you want
to seperate them in your code. Theres a small theretical chance that
some future platform will not work with mixed aligned memory and
realloc but would be able to mix both with free()

patch applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160111/5ee84c5a/attachment.sig>


More information about the ffmpeg-devel mailing list