[FFmpeg-devel] [PATCH 3/4] dict.c: Free non-strduped av_dict_set arguments on error.

Michael Niedermayer michaelni at gmx.at
Fri Aug 22 04:06:19 CEST 2014

On Sat, Aug 16, 2014 at 02:43:46PM +0200, Reimar Döffinger wrote:
> On Wed, Aug 13, 2014 at 01:57:56PM +0200, Michael Niedermayer wrote:
> > On Mon, Aug 11, 2014 at 09:17:18PM +0200, Reimar Döffinger wrote:
> > > Unfortunately this was not explicitly documented and thus
> > > might be very risky.
> > 
> > yes
> > 
> > maybe a AV_DICT_FREE_ARGS_ON_ERROR could be used, but its not as
> > convenient as getting the behavior by default
> That would add a lot of clutter and make it more inconvenient to use
> and likely to be forgotten.
> I also honestly see no real use-case for not setting it.
> One way to solve this would be to deprecate AV_DICT_DONT_STRDUP_KEY/
> AV_DICT_DONT_STRDUP_VAL, warning that they fail to free on error
> and then add new values, e.g. AV_DICT_OWN_KEY (better suggestions?)
> with the new behaviour.
> Will still be a bit of a pain to replace all uses in FFmpeg, but
> manageable.
> What do you think? Better suggestions?

i guess its either to apply the patch or not, i dont see a better
solution. renaming and deprecating options is certainly a bigger mess
and doesnt avoid the problem 

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140822/d3c2cade/attachment.asc>

More information about the ffmpeg-devel mailing list